mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Merge pull request #4628 from moyamo/master
Default to using terminfo to set the terminal title
This commit is contained in:
commit
531789e4fa
1 changed files with 8 additions and 0 deletions
|
@ -28,6 +28,14 @@ function title {
|
||||||
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
|
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
|
||||||
print -Pn "\e]2;$2:q\a" # set window name
|
print -Pn "\e]2;$2:q\a" # set window name
|
||||||
print -Pn "\e]1;$1:q\a" # set tab 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
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue