Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zimfw/termtitle
Sets a custom terminal title.
https://github.com/zimfw/termtitle
terminal zim zimfw zsh zsh-plugin zsh-plugins
Last synced: 15 days ago
JSON representation
Sets a custom terminal title.
- Host: GitHub
- URL: https://github.com/zimfw/termtitle
- Owner: zimfw
- License: mit
- Created: 2019-12-02T17:08:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T17:36:26.000Z (over 3 years ago)
- Last Synced: 2024-07-30T21:09:18.910Z (3 months ago)
- Topics: terminal, zim, zimfw, zsh, zsh-plugin, zsh-plugins
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
termtitle
=========Sets a custom terminal title.
Settings
--------The default terminal title format is `%n@%m: %~`, which corresponds to
`username@host: /path/to/working/directory`.You can set your format using [prompt expansion escape sequences].
The following example sets the format to show the current directory name:zstyle ':zim:termtitle' format '%1~'
Apple Terminal does not support the above, but a working directory escape
sequence which is sent instead.By default, the terminal title is updated before each prompt. The [hooks] to be used
can be customized with the zstyle below. For example, to have the title updated
when a command is about to be executed and also before each prompt:zstyle ':zim:termtitle' hooks 'preexec' 'precmd'
A custom title format can be set for each separate hook using the following
syntax:zstyle ':zim:termtitle:' format ''
For example, to set the titles to show the command name typed by the user while the
command is being executed and then the current directory name after the command
ended (i.e. before each prompt):zstyle ':zim:termtitle' hooks 'preexec' 'precmd'
zstyle ':zim:termtitle:preexec' format '${${(A)=1}[1]}'
zstyle ':zim:termtitle:precmd' format '%1~'Add the zstyles to your `~/.zshrc`. Make sure you add them before where the
module is initialized.[prompt expansion escape sequences]: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
[hooks]: http://zsh.sourceforge.net/Doc/Release/Functions.html#Hook-Functions