Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
54e3e8ef
Unverified
Commit
54e3e8ef
authored
Sep 29, 2021
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(lib): fix automatic title abort inside Emacs (#10124)
Closes #10124 Co-authored-by:
Paul Schorfheide
<
pschorf2@gmail.com
>
Co-authored-by:
Alastair Rankine
<
alastair@girtby.net
>
parent
de76f7cb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
termsupport.zsh
lib/termsupport.zsh
+10
-10
No files found.
lib/termsupport.zsh
View file @
54e3e8ef
...
...
@@ -10,7 +10,8 @@ function title {
emulate
-L
zsh
setopt prompt_subst
[[
"
$INSIDE_EMACS
"
==
*
term
*
]]
&&
return
# Don't set the title if inside emacs, unless using vterm
[[
-n
"
$INSIDE_EMACS
"
&&
"
$INSIDE_EMACS
"
!=
vterm
]]
&&
return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
...
...
@@ -29,12 +30,9 @@ function title {
print
-Pn
"
\e
]2;
${
2
:q
}
\a
"
# set window name
print
-Pn
"
\e
]1;
${
1
:q
}
\a
"
# set tab name
else
# Try to use terminfo to set the title
# If the feature is available set title
if
[[
-n
"
$terminfo
[fsl]"
]]
&&
[[
-n
"
$terminfo
[tsl]"
]]
;
then
echoti tsl
print
-Pn
"
$1
"
echoti fsl
# Try to use terminfo to set the title if the feature is available
if
((
${
+terminfo[fsl]
}
&&
${
+terminfo[tsl]
}
))
;
then
print
-Pn
"
${
terminfo
[tsl]
}
$1
${
terminfo
[fsl]
}
"
fi
fi
;;
...
...
@@ -105,10 +103,12 @@ function omz_termsupport_preexec {
title
'$CMD'
'%100>...>$LINE%<<'
}
autoload
-U
add-zsh-hook
add-zsh-hook precmd omz_termsupport_precmd
add-zsh-hook preexec omz_termsupport_preexec
autoload
-Uz
add-zsh-hook
if
[[
-z
"
$INSIDE_EMACS
"
||
"
$INSIDE_EMACS
"
=
vterm
]]
;
then
add-zsh-hook precmd omz_termsupport_precmd
add-zsh-hook preexec omz_termsupport_preexec
fi
# Keep Apple Terminal.app's current working directory updated
# Based on this answer: https://superuser.com/a/315029
...
...
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