You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for all your hard work on gow! It is an amazingly simple tool and it has saved me so many development hours during the time that I've used it.
I have an issue where my program has an interactive flow where it prompts the user for input at certain points, and I'm trying to run this flow using gow when doing manual testing.
Everything works perfectly, except while inputting text I cannot backspace. See video:
Screen.Recording.2023-08-15.at.13.32.38.mov
I'm on macOS 13.5 and have tried this in iTerm and Terminal.app. As seen in the video it's not just visual, the text ultimately entered has whitespace added onto it instead of characters removed from it. Is this intentional?
Thanks for any help!
EDIT: For convenience, here's the code used in the screen recording:
By default, gow switches the terminal from "cooked mode" to "raw mode", violating many common assumptions about terminal input, such as line buffering. This can be disabled in gow with -r=false.
In raw mode, gow does not support some editing functionality such as character deletion.
In non-raw mode, everything should have worked fine, but using your code sample with some modifications, I found that piping stdin to the sub-process did not work properly. The latest of the linked commits seems to address this problem.
Raw mode allows gow to support hotkeys, but it also makes gow responsible for handling ASCII control codes. Currently it handles control codes related to process state, such as various forms of shutdown and restart, but does not handle the ASCII delete code. It also doesn't handle various ANSI escape codes necessary for "proper" text editing such as cursor movement and more.
When the terminal operates in default "cooked mode" (-r=false in gow), the terminal itself handles common editing operations such as deleting characters before sending the resulting line to the sub-process. When using raw mode (default in gow), the program is responsible for interpreting ASCII delete by removing characters from its own text buffer or whatever, which also requires maintaining the cursor position and interpreting ANSI escape codes for cursor movement. When using gow, the choice of cooked vs raw is going to depend on the specific program. In your case, it seems that you want -r=false, which should work now. Let me know if you run into any issues.
Hi, thanks for all your hard work on gow! It is an amazingly simple tool and it has saved me so many development hours during the time that I've used it.
I have an issue where my program has an interactive flow where it prompts the user for input at certain points, and I'm trying to run this flow using
gow
when doing manual testing.Everything works perfectly, except while inputting text I cannot backspace. See video:
Screen.Recording.2023-08-15.at.13.32.38.mov
I'm on macOS 13.5 and have tried this in iTerm and Terminal.app. As seen in the video it's not just visual, the text ultimately entered has whitespace added onto it instead of characters removed from it. Is this intentional?
Thanks for any help!
EDIT: For convenience, here's the code used in the screen recording:
The text was updated successfully, but these errors were encountered: