sjurba / rebase-editor

Simple terminal based sequence editor for git interactive rebase.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work with git-bash on windows

sjurba opened this issue · comments

I can't get stdin.setRawMode(true) to work with Mingw which is the terminal used in Git-bash included with git on windows.

Any help, suggestions or workarounds on this issue are very welcome.

Have you found a way to use rebase-editor to work on windows with another terminal? Please let me know here.

Hi there, just tried it and yes doesn-t work with git-bash :( Works find with standard windows cmd.exe which is crap) - please fix it :))))

Don't think I can fix it really, but I came across this thread: nodejs/node#3006

From there I found a workaround that should fix the problem capturing keys.
There seems to be a program called winpty that you have to run your program through to emulate a TTY.

The workaround is to run the command like this: winpty rebase-editor.cmd
In practice this means configuring git like this:

git config --global sequence.editor 'winpty rebase-editor.cmd'

There seems to be a few more glitches that I will take a look at, but at least the app seems usable now.

Can you please try this fix and report back wether it works and if you experience any other issues?

I also recommend using the --no-alternate-screen switch. (Might make this default for windows)

git config --global sequence.editor 'winpty rebase-editor.cmd --no-alternate-screen'

Just wonder, why is the issue closed? It's still not fixed, and here is just a workaround (which works, thanks for that).

Closed it since there is no easy way for me to fix this. This is a problem with how node interacts with the terminal. It might be possible to fix in node, but more likely it must be addressed windows. Anyway, nothing I'll spend my time tackling. Also I decided to close it so people don't think it's an open issue I am or will be working on..

However if someone wants to take a stab at fixing this, that would be awesome!