Neovim-qt: titlestring doesn't work during VIMEnter

Created on 6 Feb 2016  Â·  16Comments  Â·  Source: equalsraf/neovim-qt

Doesn't seem to matter what I have set my titlestring to, but the following or similar doesn't work:
autocmd VIMEnter * set titlestring=foo

The title remains as "Neovim". Additionally, manually trying set titlestring=foo won't work after startup. You have to change the title bar to something else than what was set during VIMEnter for it to work.

waiting

All 16 comments

Its possible that VimEnter happens before the GUI is attached. Does it work if you use VimResized instead?

VimEnter            After doing all the startup stuff, including
                loading vimrc files, executing the "-c cmd"
                arguments, creating all windows and loading
                the buffers in them.

Yes, VimResized seems to work. So this is really 2 bugs:

  1. The GUI is not running when VimEnter fires. I assume this will be fixed along with #50 because GUIEnter is supposed to fire before VimEnter, and I believe #50 will be adding GUIEnter support.
  2. Upon the GUI starting, the title bar doesn't get set to the existing titlestring value. This is made worse because setting titlestring to its already set value does not update the titlebar. This is either because this is just how vim settings work, or because titlestring assumes this is a NOOP.

Upon the GUI starting, the title bar doesn't get set to the existing titlestring value. This is made worse because setting titlestring to its already set value does not update the titlebar. This is either because this is just how vim settings work, or because titlestring assumes this is a NOOP.

As far as I can see, the GUI never gets notified for the same string twice. The relevant code in Neovim seems to be this https://github.com/neovim/neovim/blob/5308585adf8140e232602c96e22909371736d826/src/nvim/buffer.c#L2767

Looks like that to me too. I wouldn't consider that a bug necessarily, it
just really makes the real bug more obvious of not setting the title on the
GUI starting.

On Sat, Feb 6, 2016 at 6:10 PM, Rui Abreu Ferreira <[email protected]

wrote:

Upon the GUI starting, the title bar doesn't get set to the existing
titlestring value. This is made worse because setting titlestring to its
already set value does not update the titlebar. This is either because this
is just how vim settings work, or because titlestring assumes this is a
NOOP.

As far as I can see, the GUI never gets notified for the same string
twice. The relevant code in Neovim seems to be this
https://github.com/neovim/neovim/blob/5308585adf8140e232602c96e22909371736d826/src/nvim/buffer.c#L2767

—
Reply to this email directly or view it on GitHub
https://github.com/equalsraf/neovim-qt/issues/95#issuecomment-180882532.

I was going to add a new issue regarding the GUI title ("Neovim", instead of the name of the open buffer), but I guess this is the right issue.
Is there a quickfix? I am using neovim-qt as my default editor, and this issue is really annoying. I usually fire multiple neovim-qt sessions, and my task bar just shows Neovims :laughing:!

What happens if you set it in ginit.vim instead of init.vim_

It doesn't work either.

Testing here it does set the buffer name in the window title.

  • is set title on?
  • are you using a custom titlestring?

set title fixed the issue. I did not need this option in qvim, though.
Thanks for the feedback

Update: when I open a file with nvim-qt using :e filename the title is correctly set. However if I open a file with my terminal $nvim-qt filename the title is not set.

However if I open a file with my terminal $nvim-qt filename the title is not set.

I see it, its mostly the same as the original bug report. This needs to be checked upstream.

is the conclusion that this is an issue that need to fix in nvim?

Any news on this? I have the same issue as @fcladera described in https://github.com/equalsraf/neovim-qt/issues/95#issuecomment-248464656 (the set title trick after nvim-qt filename also works for me). I'm using the latest development build from today and I'm otherwise very satisfied with this build.

@dumblob Could you please describe how exactly the command line looks like? I've tried the different options (like nvim-qt C:\log.txt -- -c "set title") but it doesn't set title correctly on start :(

@zvirja I didn't try it on the command line, but in two steps:

  1. nvim-qt c:\log.txt
  2. (in the freshly opened nvim-qt window) :set title

So, the issue is not solved. But at least setting the title by hand after nvim is freshly opened (might be about 4 seconds after the command nvim-qt c:\log.txt was issued) works.

@dumblob Thanks for the reply! I also found that way, but it's not perfect. Thought that probably you have found a way to make it work automatically :( I wish I could fire a PR, but I don't know the project at all.. Hope one day somebody will fix this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eyalk5 picture eyalk5  Â·  3Comments

mhinz picture mhinz  Â·  4Comments

jdhao picture jdhao  Â·  7Comments

einars picture einars  Â·  5Comments

gwerbin picture gwerbin  Â·  10Comments