Window title does not reset after exiting neovim #3636
-
Not sure if this is an issue so I'm asking here first. I'm using https://github.com/knubie/vim-kitty-navigator to use the same hotkeys for navigating neovim and kitty windows. This works fine, but for some reason the window title is not reset when I'm exiting neovim. This works fine in iTerm2, so I assume there is either a bug or I misconfigured something. I'm setting the window title via neovim like this in the init.vim:
kitty --debug-config
While testing this with
I also tried setting the title manually with iTerm2: After starting iTerm: After starting neovim: After exiting neovim: After launching kitty: After starting neovim: After leaving neovim: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
The terminal knows nothing about when programs launched by shells start or quit. If the title is being reset it means either that the program itself is resetting it or the shell is doing so after the program quits. If I had to guess, I would guess the shell. Presumably you have some iterm specific config in your shell rc files. I suggest you add the following to .zshrc, which will work aith any terminal not just iterm # Show the current working directory in the terminal window titlebar
function set-title-precmd () { printf "\033]2;${PWD/$HOME/~}\007" }
function set-title-preexec() { printf "\e]2;%s\a" "$1" }
autoload -Uz add-zsh-hook
add-zsh-hook precmd set-title-precmd
add-zsh-hook preexec set-title-preexec |
Beta Was this translation helpful? Give feedback.
-
It works fine for me with vim, I dont use nvim so cannot comment on it. Steps I tried:
|
Beta Was this translation helpful? Give feedback.
-
On Tue, May 18, 2021 at 05:02:16AM -0700, James McCoy wrote:
XTWINOPS has 3 parameters. Yes, some of the parameters may not be used yet for some of the sub-commands. However, I can send `\e[22t` and that implicitly means `\e22;0t`.
Says, who? I can see nowhere in the specification that says that. It
might be an *implied* behavior but it certainly isn't *specified*.
By that same logic, if it does get a new parameter, then either everything not sending the third parameter becomes insta-buggy or the 0 value is the same behavior as today and anything sending `\e[22t` or `\e[22;0t` get the implied 0 value. So, I don't see why sending the explicit third parameter is a problem.
Umm why are you arguing about this? Is it your position that nvim *should*
be sending an extra meaningless two bytes? If so, why? And if not, why
not spend this energy sending a patch for nvim instead?
Also kitty 0.19.3 behaves as expected with your moose example, so it seems kitty has become more strict about this in the interim.
Indeed, I have been gradually tightening kitty's parser with time.
|
Beta Was this translation helpful? Give feedback.
-
On Tue, May 18, 2021 at 05:55:23AM -0700, James McCoy wrote:
> Umm why are you arguing about this? Is it your position that nvim *should* be sending an extra meaningless two bytes?
No, I'm arguing that your parser is being unnecessarily strict.
The terminal ecosystem could really do with a little strictness.
> And if not, why not spend this energy sending a patch for nvim instead?
I've already done that.
Excellent, thanks, then this issue is resolved. If someday there is a
plague of software sending meaningless zeros with this escape code, I
will reconsider relaxing the parser.
|
Beta Was this translation helpful? Give feedback.
It works fine for me with vim, I dont use nvim so cannot comment on it. Steps I tried: