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

Issue: Running vim using sudo hangs. #248

Closed
sebthom opened this issue Apr 7, 2023 · 2 comments · Fixed by #336
Closed

Issue: Running vim using sudo hangs. #248

sebthom opened this issue Apr 7, 2023 · 2 comments · Fixed by #336
Labels
help wanted Extra attention is needed

Comments

@sebthom
Copy link

sebthom commented Apr 7, 2023

Issue Description

I am trying to run vim with sudo but the process hangs.

Steps to Reproduce

  1. Install scoop
  2. Install gsudo and git-with-openssh via scoop
  3. Try to execute vim via sudo, e.g.
    > C:\scoop\shims\sudo.exe C:\scoop\shims\apps\git-with-openssh\current\usr\bin\vim.exe
    
    This results in a blank command window that does not react to any keyboard interaction. Aborting using CTRL+C is ignored.

The same works fine using this sudo implementation: https://github.com/chrisant996/sudo-windows/

Screenshots

image

Context:

  • Windows version: Microsoft Windows [Version 10.0.19045.2728] 22H2 - English
  • gsudo version: gsudo v2.0.6 (Branch.tags-v2.0.6.Sha.6da4723971cc95f4285797b31545ddfdd2ceca0d)
@sebthom
Copy link
Author

sebthom commented Apr 7, 2023

Seems to work when I use the --copyev flag for some reason.

@gerardog
Copy link
Owner

gerardog commented Apr 8, 2023

If I gsudo vim and then kill vim.exe it will show the arrow keys as a character escape sequence, which is something I havent seen before, maybe this is a problem handling the console mode.
image

I'll investigate, but in the meantime you can workaround it by running:

gsudo config ExceptionList = "notepad.exe;powershell.exe;vim.exe;"

...that will wrap vim into cmd /c vim. That avoids the problem.

Seems to work when I use the --copyev flag for some reason.

Yes gsudo --copyev vim does cmd /c RunBatchFileWithEnvVars & vim, so the savior CMD is added.

@gerardog gerardog assigned gerardog and unassigned gerardog Apr 17, 2023
@gerardog gerardog added the help wanted Extra attention is needed label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants