Hajime icon indicating copy to clipboard operation
Hajime copied to clipboard

Arrow Up/Down Command History Works but is incorrectly displayed

Open ghost opened this issue 2 years ago • 3 comments

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.

ghost avatar Mar 19 '22 19:03 ghost

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 avatar Jun 17 '22 03:06 Slackadays

@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 avatar Oct 03 '22 02:10 Slackadays

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.

Slackadays avatar Oct 21 '22 16:10 Slackadays