joedf / Qonsole

A Quake-like Console Emulator written in AutoHotkey.
http://qonsole-ahk.sourceforge.net/
MIT License
86 stars 15 forks source link

WSL Ubuntu ssh-keygen error with things like ^[[F #8

Open roachsinai opened 5 years ago

roachsinai commented 5 years ago

I like this great guake-like console, but if I open it I get input errors when I use Microsoft/WSL. When I press Enter key, I sometimes got extra ^[[F output.

I thought it was a wsl problem first, finally I found maybe there is some conflicts between Qonsole and WSL or other reason I don't know.

roach@hwin:~$ ssh-keygen -t rsa -b 4096 -C "myself@email.com"
^[[FGenerating public/private rsa key pair.
Enter file in which to save the key (/home/roach/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
.pub. same passphrase again:
The key fingerprint is:n saved in aved in
SHA256:some_code_like_Y38NnKD+LByV48bRmGri89dK1q+_this_things myself@email.com
The key's randomart image is:
+---[RSA 4096]----+
|                 |
|                 |
|       o         |
|       .         |
|       o.     +  |
|        B      o |
|    .  . =@.* =  |
| E +           . |
| .=o.. +   .  ..o|
+----[SHA256]-----+
roach@hwin:~$ ls
^[[F''$'\033''[F'  ''$'\033''[F.pub'
roach@hwin:~$ eval $(ssh-agent -s)
^[[FAgent pid 1249
roach@hwin:~$ ssh-add ~/.ssh/id_rsa
^[[FEnter passphrase for /home/roach/.ssh/id_rsa:
Bad passphrase, try again for /home/roach/.ssh/id_rsa:
^[[FIdentity added: /home/roach/.ssh/id_rsa (/home/roach/.ssh/id_rsa)
roach@hwin:~$

There are many ^[[F, more details at WSL/3572.

roachsinai commented 5 years ago

If I close qonsole, the operations above works well.

joedf commented 5 years ago

Interesting... Thanks for reporting this.

If you run qonsole in the background, but run your program in a a separate normal cmd, do you still get this issue? Perhaps one of the key bindings in Qonsole is not correctly filtered.

roachsinai commented 5 years ago

image

No, man it's hard to locate it (╯‵□′)╯︵┴─┴. I reinstall wsl 3 times with different distributions. But glad to find reason.

As you can see, I press Enter several times in CMD which works well different to wsl termianl.

Ignore <<< shows on wsl, it means zsh auto suggestion plugin change to vim normal mode, by the way I don't know how ^[[F trigger that mode.

roachsinai commented 5 years ago

image

After quit qonsole things go well, the blank line maybe caused by the reaction time of wsl.

roachsinai commented 5 years ago

looks like the ^[[F may be as a result of using qonsole based on the virtual key sequence they're sending to the console. As a result it's rendering the ^[[F since there is a mismatch between UTF-8 and ASCII.

from WSL/3572.

joedf commented 5 years ago

Ok, I'll release a patch-fix. I have attached a test version. Let me know if it works... Qonsole_v1.4.5b.zip

roachsinai commented 5 years ago

image

get this error.

TakehiroTada commented 5 years ago

Hi, I'm the same thing, too. Please help me. I use v1.4.5b

default

joedf commented 5 years ago

Hmm... Weird... I didn't change anything with the attachment code... A_LastError: 6 means ERROR_INVALID_HANDLE... It means Qonsole could not find the console window... Try opening a normal CMD window then launching Qonsole. I've had this issue for a long time, it seems Windows does something weird when a window is "hidden"...

roachsinai commented 5 years ago

Get same error both run from cmd and powershell. :-(

joedf commented 5 years ago

Nothing changed other than removing a keyboard config. You might have to reinitialize your settings or something...? Also, maybe try checking the "Use legacy console" checkbox in cmd properties.

roachsinai commented 5 years ago

I removed old Qonsole_settings.ini and cmd_Qonsole and run Qonsole.exe to create them, and after the creation of them, I get the AttachFailure error.

The location of Qonsole on my pc is C:\Users\DD\Documents\__PortableSoft\Qonsole, the content of Qonsole_settings.ini is:

CMD_Path=C:\Users\DD\Documents\__PortableSoft\Qonsole\cmd_Qonsole.lnk

The target of cmd_Qonsole is C:\Windows\System32\cmd.exe.

joedf commented 5 years ago

Ok... Are you able to revert to the original version with original settings, or does it crash also?

roachsinai commented 5 years ago

Sorry, I delete original settings, but original version Qonsole(1.4.4) get error now, too.

davidwincent commented 5 years ago

I am also getting extra ^[[F on enter

sudo commands always gives Sorry, try again.

Qonsole version: 1.4.5 (2018/03/27) Windows build: 10.0.17763 N/A Build 17763 WSL distribution: WLinux 1.1.28.0

Qonsole_settings.ini =>

[Settings]
CMD_Path=C:\usr\local\bin\cmd_Qonsole.lnk
HideOnInActive=0
HorizontallyCentered=1
BottomPlaced=0
CmdPaste=1
AutoWinActivate=0
ReduceMemory=1
RunOnStartUp=1
Console_Mode=Cmd
TransparencyPercent=10
OpenHotkey=#z
CMD_Width=1680
CMD_Height=800
CMD_StartUpArgs=/C wlinux.bat
CMD_offset=0
[Animation]
Speed=2
Delay=10
dx=25
AnimationDisabled=1
GuiBGDarken_Increment=6
GuiBGDarken_Max=0
GuiBGDarken_Color=0x1A1A1A

wlinux.bat =>

c:\Users\dawi\AppData\Local\Microsoft\WindowsApps\WhitewaterFoundryLtd.Co.16571368D6CFF_kd1vv0z0vy70w\wlinux.exe
joedf commented 5 years ago

@davidwincent Thank you for your report. Could you try with Qonsole_v1.4.5b?

davidwincent commented 5 years ago

@joedf F-Secure does not agree image

joedf commented 5 years ago

It's a false positive. There's nothing I can do about that. If you don't trust the exe file, you can run it from source here: Qonsole_v1.4.5-source.zip

davidwincent commented 5 years ago

@joedf seems f-secure likes it better if I build it on my machine with Ahk2Exe

I still get the problem with random weird characters

david@WS-628:~$ y
-bash: y: command not found
david@WS-628:~$ y
-bash: y: command not found
david@WS-628:~$ y
-bash: y: command not found
david@WS-628:~$ y
^[[F-bash: y: command not found
david@WS-628:~$ y
-bash: y: command not found
joedf commented 5 years ago

Hmmm weird. What if you try it with console2? https://sourceforge.net/projects/console/files/console-devel/2.00/