0
votes

I'm trying to set my terminal's tab title in iterm2. It works when I'm at the shell with using

echo -ne "\033];foobar\007"

but when I do it in neovim, the tab title doesn't change. In neovim I'm trying it with

!echo -ne "\033];foobar\007"

My shell is zsh and not I'm using tmux or anything like that (tmux tag is deliberately missing in this question although its often related to stuff like this). I tried some variants of that echo command (e.g. \a instead of \007 but thats just zsh sugar) and tried to use a function I've found at https://gist.github.com/bignimbus/1da46a18416da4119778 but also without any luck.

I've set the option in my iTerm2 profile that the terminal is allowed to set tab title and window title. As I said that even works if I just echo that string from the shell without being in vim.

Any ideas what I might be missing?

1

1 Answers

2
votes

Ok, this was way easier than I thought. I don't know why the above does not work in neovim, I believe it is due to the different implementation of :! but as my problem is actually the title of the tab and not the difference in that implementation I can simply use

set title

(which seems off by default, at least on my setup) which sets the title to the current filename or whatever I set for titlestring. Seems to work for plain vim as well. I wonder why I haven't found this but those countless hacky echo snippets.