vim-startuptime icon indicating copy to clipboard operation
vim-startuptime copied to clipboard

Doesn't work if aliased with --startuptime in shell

Open ppebb opened this issue 3 years ago • 8 comments

I have an alias with neovim as nvim --startuptime /tmp/nvim-startuptime because I have something to read startuptime onto my dashboard. This breaks vim-startuptime.

ppebb avatar Jul 26 '22 21:07 ppebb

Hi @pollen00, can you provide details on (1) the error message you're encountering (and/or any other information on how vim-staruptime is breaking), (2) details on how you have the alias set up, and (3) if relevant, information about the dashboard?

dstein64 avatar Jul 26 '22 22:07 dstein64

The error is just the "Is vim-startuptime stuck on 0% progress?" screen. I can run neovim in a nested terminal just fine, and the screen goes away and everything works once I remove the alias. The alias is set through my zshrc.

ppebb avatar Jul 26 '22 23:07 ppebb

I'm not sure what could be causing the issue.

I've updated vim-startuptime to include additional debugging information on the screen you're stuck on.

It should now include something like the following (this is what's shown for me, which quickly disappears since I don't encounter any issue):

  It may help to run a nested instance of (n)vim in a manner similar
  to vim-startuptime. The following lines show the shell-escaped
  program and arguments used by vim-startuptime. <OUTPUT> should be
  replaced with an output file.

    '/usr/bin/vim.gtk3'
      '--startuptime'
      '<OUTPUT>'
      '-c'
      'if exists('\''*timer_start'\'') | call timer_start(0, {-> execute('\''qall!'\'')}) | else | autocmd VimEnter * qall! | endif'

Can you post that information here and/or try running a nested Neovim with the program and arguments from the information that's shown for you (if so, be sure to replace <OUTPUT> with a real file path for saving the startuptime output)?

dstein64 avatar Jul 27 '22 02:07 dstein64

This is what's shown in the 0% menu.

    '/usr/bin/nvim'
      '--startuptime'
      '<OUTPUT>'
      '-c'
      'if exists('\''*timer_start'\'') | call timer_start(0, {-> execute('\''qall!'\'')}) | else | autocmd VimEnter * qall! | endif'

Trying to run with those arguments just spits out error detected while processing command line: so I think there might be something wrong with all of the single quotes in -c

ppebb avatar Jul 27 '22 02:07 ppebb

The arguments are shell-escaped, so I'm not sure what's causing the problem. Does the following command run from a :terminal within Neovim?

/usr/bin/nvim --startuptime startuptime_output -c 'if exists('\''*timer_start'\'') | call timer_start(0, {-> execute('\''qall!'\'')}) | else | autocmd VimEnter * qall! | endif'

dstein64 avatar Jul 27 '22 02:07 dstein64

It runs, flashes for a sec, and then returns to the :terminal. Nothing is printed out to the console.

ppebb avatar Jul 27 '22 03:07 ppebb

That's the working behavior. I thought maybe there would be a notification of some error.

Can you share the alias command? I'll try to reproduce by matching your configuration.

dstein64 avatar Jul 27 '22 03:07 dstein64

It's just alias nvim="nvim --startuptime /tmp/nvim-startuptime"

ppebb avatar Jul 27 '22 03:07 ppebb