Kitty: Set tab name or window title automatically to the current directory or file

Created on 8 Sep 2018  路  6Comments  路  Source: kovidgoyal/kitty

Is there a way to set the tab name or window title to the current directory or file you are in as you move around?

I see you can set tab names and window titles using remote, but is there a way to listen to changes for which directory or file you are in? Could this be added as a kitty config setting to be set automatically?

I like to work with several tabs open and now they all say bash. I guess i could set the tab name as i open them but then it would stick if i change the folder.

I'm on macOS, using kitty 12.1

Most helpful comment

All 6 comments

In zsh it's done via precmd () {print -Pn "\e]0;%~\a"} in .zshrc

In zsh it's done via precmd () {print -Pn "\e]0;%~\a"} in .zshrc

I add your codes in my .zshrc but nothing's changed.
What may I missed?
Thank you.

What may I missed?

  • You use a terminal emulator other than kitty?
  • You didn't restart it?

What may I missed?

  • You use a terminal emulator other than kitty?
  • You didn't restart it?

Thank for quick response.

  • I installed other terminals, but at now, I am only opening kitty.
  • I run source ~/.zshrc. May I do anything?

Thank you again.

Try to close all instances of kitty and run it again. I have the exact same line in my .zshrc and it works perfectly.

UPD: also ensure that line is placed in the end of .zshrc

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JJGO picture JJGO  路  3Comments

bewzaalex picture bewzaalex  路  3Comments

metalelf0 picture metalelf0  路  4Comments

wavexx picture wavexx  路  3Comments

reed-jones picture reed-jones  路  4Comments