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
ef7e53a7
Commit
ef7e53a7
authored
Feb 10, 2015
by
Robby Russell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3568 from mcornella/apjanke-title-disable-check
Repost #3426: move DISABLE_AUTO_TITLE check to hooks
parents
6aa9720b
2e41d06b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
termsupport.zsh
lib/termsupport.zsh
+23
-7
No files found.
lib/termsupport.zsh
View file @
ef7e53a7
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
#Fully support screen, iterm, and probably most modern xterm and rxvt
# Set terminal window and tab/icon title
#
# usage: title short_tab_title [long_window_title]
#
# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
# Fully supports screen, iterm, and probably most modern xterm and rxvt
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function
title
{
if
[[
"
$DISABLE_AUTO_TITLE
"
==
"true"
]]
||
[[
"
$EMACS
"
==
*
term
*
]]
;
then
return
fi
[[
"
$EMACS
"
==
*
term
*
]]
&&
return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
:
${
2
=
$1
}
if
[[
"
$TERM
"
==
screen
*
]]
;
then
print
-Pn
"
\e
k
$1
:q
\e\\
"
#set screen hardstatus, usually truncated at 20 chars
elif
[[
"
$TERM
"
==
xterm
*
]]
||
[[
$TERM
==
rxvt
*
]]
||
[[
$TERM
==
ansi
]]
||
[[
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
elif
[[
"
$TERM
"
==
xterm
*
]]
||
[[
"
$TERM
"
==
rxvt
*
]]
||
[[
"
$TERM
"
==
ansi
]]
||
[[
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
print
-Pn
"
\e
]2;
$2
:q
\a
"
#set window name
print
-Pn
"
\e
]1;
$1
:q
\a
"
#set icon (=tab) name
fi
...
...
@@ -18,6 +26,10 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Runs before showing the prompt
function
omz_termsupport_precmd
{
if
[[
$DISABLE_AUTO_TITLE
==
true
]]
;
then
return
fi
title
$ZSH_THEME_TERM_TAB_TITLE_IDLE
$ZSH_THEME_TERM_TITLE_IDLE
# Notify Terminal.app of current directory using undocumented OSC sequence
...
...
@@ -30,6 +42,10 @@ function omz_termsupport_precmd {
# Runs before executing the command
function
omz_termsupport_preexec
{
if
[[
$DISABLE_AUTO_TITLE
==
true
]]
;
then
return
fi
emulate
-L
zsh
setopt extended_glob
...
...
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