Repository navigation
Conversation
Toggle raw mode for stdin before and after launching the editor, so that input handling does not interfere with functionality of console-based editors like Vim
|
I tried this fix and it doesn't work for me. This is an issue in opentui, which I created a fix for: anomalyco/opentui#331 Anyhow, I don't see how this would fix it since the editor itself enables raw mode on stdin. |
Interesting, @veracioux . Thanks for your work on that opentui change. Surprised the raw input toggle doesn't work for you, but perhaps our situations are entirely different. When you say "the editor itself enables raw mode on stdin" -- what do you mean? I agree that Neovim or other editors may likely be using raw mode -- wouldn't that be an argument in favor of disabling raw mode (Opencode or OpenTUI conceding keypress handling) before transitioning to the editor? Whatever works that fixes this. I am just trying to understand the functionality better. |
|
@bowmanjd Well, based on my understanding of ttys (based on experience with linux, are you on windows perhaps?), the raw mode setting applies per tty, not per process per tty. Since stdin is inherited from opencode by the editor, these two pretty much cancel each other out: In the end there is only one stdin and it will have the last of those values active. Also, if you look at the opentui source code, it already disables raw mode in renderer.suspend(): https://github.com/sst/opentui/blob/main/packages/core/src/renderer.ts#L1289 I'm not sure why we have different behaviors. Are you sure you are able to reproduce the issue reliably? |
Always a good question! I, too, am on Linux (NixOS) and am using Neovim 0.11.5. I have tried two things that fix the issue immediately:
Both of the above worked a few hours ago. And yet, of course, now that I try to replicate the issue, I cannot. I am on v1.0.85 and, with or without the changes from my PR, the editor is working just fine. I just changed to v1.0.86, as well, and it is also working fine there. Sorry, without being able to replicate, I now distrust that I am able to reproduce the issue reliably. The only thing I can think that has changed is a rebuild of my NixOS installation. |
|
@bowmanjd Make sure that the actual installed version of @opentui/core and @opentui/solid is 0.1.47 (since that is the version that introduces the regression). |
|
Correct. According to my bun.lock file, both are at 0.1.47. |
cc5d9a7 to
48949a6
Compare
|
Closing this because it was not effective. The ephemeral nature of the issue on my machine caused me to incorrectly think this change had fixed the problem. |
Toggle raw mode for stdin before and after launching the editor, so that input handling does not interfere with functionality of console-based editors like Vim.
I love Bun and love raw input mode, but this seems like a case where we should totally delegate keyboard control to the external editor, correct?
Solves #4209 and #4586