extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.66k stars 571 forks source link

Vim is not available as external editor on windows #1316

Open ShrykeWindgrace opened 2 years ago

ShrykeWindgrace commented 2 years ago

Thanks for gitui, it makes my daily life easier=)

There is, however, one thing that seems break my current flow - I can not launch vim from within gitui.

Describe the bug Vim is not available as external editor

To Reproduce Steps to reproduce the behavior:

  1. Navigate to a repo with modified files, run gitui
  2. Chose a file with modifications
  3. Hit 'e' button to edit this file
  4. A "popup" appears:
    failed to launch editor:
    "vim": program not found

    Same bug observed when trying to '^e'dit commit message in external editor.

Expected behavior A vim instance with selected file loaded.

Context (please complete the following information):

Additional context vim is present in path:

PS1> where.exe vim
C:\Windows\vim.bat

and git is configured to use vim

git config  -l | rg editor
core.editor=vim
extrawurst commented 2 years ago

need windows user support for this

ShrykeWindgrace commented 2 years ago

I did a bit of digging

I see the following solutions:

ShrykeWindgrace commented 2 years ago

Aha, it appears that things are not that easy upstream...

https://github.com/rust-lang/rust/issues/37519

https://doc.rust-lang.org/src/std/process.rs.html#540-543

https://github.com/rust-lang/rust/pull/37381

... and all the way down the rabbit whole...

metasong commented 2 years ago

vs code is also not usable because of this. I have mine editor in git config:

git config -l|?{$_ -like '*edit*'}
core.editor=code --wait

and

gcm code

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     code.cmd                                           0.0.0.0    C:\Program Files\Microsoft VS Code\bin\code.cmd
pm100 commented 1 year ago

investigating this.

Thr std::Process code is really very broken, making all sorts of odd assumptions trying to make things work 'by magic'. I will file a bug but dont hold your breath.

I think I can come up with a solution - will update here

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

mcmoodoo commented 1 month ago

what about vim bindings in gitui? do they exist and just not enabled by default? I mean like to move up/down (j/k). Otherwise I will gladly look into implementing this as a feature. Let me know please.

I am on Linux btw.