Set term title to command currently running

Amolith created

Change summary

private_dot_zshrc.tmpl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Detailed changes

private_dot_zshrc.tmpl 🔗

@@ -24,8 +24,9 @@ zstyle ':zim:input' double-dot-expand yes
 # Set a custom terminal title format using prompt expansion escape sequences.
 # See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
 # If none is provided, the default '%n@%m: %~' is used.
-# TODO
-#zstyle ':zim:termtitle' format '%1~'
+zstyle ':zim:termtitle' hooks 'preexec' 'precmd'
+zstyle ':zim:termtitle:preexec' format '${${(A)=1}[1]}'
+zstyle ':zim:termtitle:precmd'  format '%1~'
 # Customize the style that the suggestions are shown with.
 # Set what highlighters will be used.
 # See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md