Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
c1446b47
Commit
c1446b47
authored
Jul 06, 2019
by
Erik Demaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic title: Replace fg with description from jobs
parent
b259cdf7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
termsupport.zsh
lib/termsupport.zsh
+13
-1
No files found.
lib/termsupport.zsh
View file @
c1446b47
...
@@ -72,7 +72,19 @@ function omz_termsupport_preexec {
...
@@ -72,7 +72,19 @@ function omz_termsupport_preexec {
local
CMD
=
${
1
[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]
:gs/%/%%
}
local
CMD
=
${
1
[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]
:gs/%/%%
}
local
LINE
=
"
${
2
:gs/%/%%
}
"
local
LINE
=
"
${
2
:gs/%/%%
}
"
if
[[
"
$CMD
"
=
fg
]]
;
then
# replace fg, possibly with argument, with description from jobs
local
JOB
if
[[
${
(z)1
}
=
fg
]]
;
then
# no arguments
JOB
=
"
$(
jobs
%%
)
"
else
# arguments
JOB
=
"
$(
jobs
${${
(z)1
}
[2]
})
"
fi
JOB
=
"
${${
(z)JOB
}
[4,
$]
}
"
# trim job number, +, pid, status
title
${
JOB
:gs/%/%%
}
${
JOB
:gs/%/%%
}
else
title
'$CMD'
'%100>...>$LINE%<<'
title
'$CMD'
'%100>...>$LINE%<<'
fi
}
}
precmd_functions+
=(
omz_termsupport_precmd
)
precmd_functions+
=(
omz_termsupport_precmd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment