Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ppebb opened this issue Jul 26, 2022 · 8 comments
Open

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

ppebb opened this issue Jul 26, 2022 · 8 comments

Comments

@ppebb
Copy link

ppebb commented Jul 26, 2022

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.

@dstein64
Copy link
Owner

dstein64 commented Jul 26, 2022

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?

@ppebb
Copy link
Author

ppebb commented Jul 26, 2022

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.

@dstein64
Copy link
Owner

dstein64 commented Jul 27, 2022

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)?

@ppebb
Copy link
Author

ppebb commented Jul 27, 2022

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

@dstein64
Copy link
Owner

dstein64 commented Jul 27, 2022

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'

@ppebb
Copy link
Author

ppebb commented Jul 27, 2022

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

@dstein64
Copy link
Owner

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.

@ppebb
Copy link
Author

ppebb commented Jul 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants