-
Notifications
You must be signed in to change notification settings - Fork 6
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
Entering backslash character '\' on windows causes null byte input '\x00' #38
Comments
Hello @pygrum, Are you using the Windows Terminal (the new one) or the legacy cmd.exe prompt ? If you are using the latter, please know that there is pretty much no support for it by this library. Many things won't work at all. Related to this, this non-printed backslash was already an issue here, but should have been solved since. I'm thus eager to know what causes this ! Cursors: See the readline documentation (options/config page) for ways to change cursor styles. Finally, between v0.1.6 and v0.1.13 lots of things have been fixed, so I would advise upgrading your dependencies (Sliver is going to do it as well). |
Hi @maxlandon Thanks for the response. I'm not sure what causes this. I've just tested on Windows Terminal as well as Command Prompt (both my app and sliver), and the no backslash, null bytes issue persists after a new build. I'm doing basic initialisation of the console (console.New("abc"); Run()) so I'm not sure if it's something on my side. Here it is, running on windows terminal. Finally, I would love to update (especially using my syntax highlight change request lol) but I've had to downgrade to use carapace completion alongside your carapace patch. It might be a straightforward fix on my side but I'll have to look into it more. Thanks for your work on this library. |
Okay, an update. I updated to the latest console version and null bytes aren't being registered, which is nice! However, backslashes still aren't being registered or appearing. The fact that the beam cursor isn't adopted might be another symptom of the underlying issue. I'll keep testing around and get back if I've found a permanent fix. |
Okay so a couple things:
|
Great to hear those updates. Thanks again, I look forward to the release! Meanwhile, I'll look for solutions to the backslash issue. PS: could you show me the logic behind this / where it occurs in code?
|
Hello @maxlandon , an FYI I've just compiled and tested for darwin/amd64 (on a separate machine) and backslashes don't register here either. If you have access to a non-linux machine maybe you could test that to make sure it's a real issue? |
Ok unfortunately since a few days I don't have access to either Windows or MacOS. Could you give me the result of the following things (on Windows and/or MacOS) ?
Could you give me an example please ? |
I've opened a new branch ( To explain, so when the line is split and the last character is an unterminated escape sequence, I used not to return it to the completion engine. I've commented the line so that now, the backspace is also returned. Normally (but I'm not positive at all), this should solve your completion problem when a backspace is inserted. |
Hello @pygrum , please be advised that in a week, I won't be available to do anything on this repository for several months (I will be strictly and unavoidably away from a laptop). Thus it would be great if we can solve this this week ! |
By the way, quite unrelated, but I looked at your monarch repo, and I thought you might be interested in https://github.com/reeflective/team: it's the extracted teamclient/teamserver code of Sliver. |
I could've been a bit clearer here.
Somehow. MacOS and Windows builds completely ignore backslash in most contexts. Maybe there's an odd build constraint somewhere? |
I will be using the console for only linux builds, as I'd planned to eventually make a GUI for non-linux hosts. So no worries, this issue isn't exactly a blocker for me! And https://github.com/reeflective/team looks awesome! I'd definitely try it out when I next plan to use a client-server CLI infrastructure. I'll leave this issue open in case I do find anything while you are away. Thanks for your help with this |
I'm probably waiting for some time or someone who will jump in when they feel the need for this to be fixed. |
Hello @pygrum, so when actually writing a summary of what remained to do, the problems to solve and so on, I decided to open a new dedicated issue, since apparently the null bytes on Windows are not a problem anymore, and that the discussion on backslash treatment concerns all platforms/users. So closing this issue, but opened this one #43. If you need anything or if you have any ideas, feel free to share ! (Also, I deleted your message and my response to it about the crash when completing: this is solved, please update to v0.1.15) |
I was debating whether to post this here or on the readline issue page.
Affects
Windows only - works fine on Ubuntu and MacOS
I'm using version 0.1.6 of console and 1.0.12 of readline.
Issue
Whenever entering the backslash character, nothing seems to happen. However invisible null chars are sent the prompt, so that when I hit 'enter' I'll get 'unknown command "\x00" for ...'.
Now Sliver uses the same library and doesn't seem to share this issue for Windows builds. What I've also noticed is that my typing prompt (on cmd.exe) is a block cursor, while Sliver's is a regular line cursor. So perhaps it is a setting that I haven't explored. Note too, that the same versions of both readline and console are in use. Your support would be appreciated!
The text was updated successfully, but these errors were encountered: