Skip to content
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

Arrow Up/Down Command History Works but is incorrectly displayed #15

Open
ghost opened this issue Mar 19, 2022 · 3 comments
Open

Arrow Up/Down Command History Works but is incorrectly displayed #15

ghost opened this issue Mar 19, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 19, 2022

Describe the bug
When using arrow keys to find a previously typed command, the text is displayed as ^[OA but the command works if you send it. You just can't see what you pulled from the history.

Reproduction
Bug can be reproduced on latest release of hajime, as well as latest build compiled from source.

Expected behavior
Show the command history normally.

Other info
Using latest build of Purpur, as well as Hajime.

@Slackadays
Copy link
Owner

I'm suspecting that the cause of this issue is a compatibility setting of one of the terminals that Hajime uses to show server text. However, I can't say for sure, and it's possible that this setting is completely irrelevant as I think this same issue happens on Windows.

@Slackadays
Copy link
Owner

@bluestormhunter I just remembered why this happens. When you make a terminal or use one, you can set characters to echo or not and whether the terminal is raw. Currently, we have it set to raw with echoes which lets us easily send characters to the server. Unfortunately, the terminal you access doesn't know not to display non-text characters such as tabs or arrow keys, so it displays them just like regular text, which looks like ^[OA because that's how those characters are processed internally.

The fix is to disable echoing, which would work great. However, this means we now have to make rules to manually display characters depending on what key you pressed, which is going to be a lot of work.

@Slackadays
Copy link
Owner

I've been doing some testing and it looks like this issue can't be fixed unless something changes on the server side, as it depends on some regular terminal being present and expects its regular behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant