https://bugs.winehq.org/show_bug.cgi?id=54141
Bug ID: 54141 Summary: console: pressing ctrl+4 in any console application terminates it Product: Wine Version: 7.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: taviso@gmail.com Distribution: ---
Reproduce:
$ wine cmd.exe Z:\home\taviso>
[Now press Ctrl+4]
I think all of the Ctrl+Number keys don't work (oddly, except Ctrl+2), but Ctrl+4 is especially annoying because it immediately terminates the application.
I was trying to use a Windows console application, but didn't have much luck because of the missing keybindings.
https://bugs.winehq.org/show_bug.cgi?id=54141
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #1 from Eric Pouech eric.pouech@gmail.com --- a couple of questions: - which kind of keyboard are you using? (couldn't reproduce here on French Keyboard) - which '4' key are you using? (numeric row, numeric keypad...)? - does 'wine wineconsole cmd.exe' give you different results?
TIA
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #2 from Tavis Ormandy taviso@gmail.com --- Hmm that's surprising - it's a UK keyboard, and the numeric row keys.
I can only get the application (the hex editor hiew) to recognize ctrl-2 from that row.
It seems to work fine with `wine wineconsole cmd.exe`, but it almost works in a terminal and that would be really nice!
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #3 from Eric Pouech eric.pouech@gmail.com --- that looks like a key binding issue: - in a blank xterm, at unix shell prompt (no wine invocation), does also ctrl-4 close the xterm windows?
(that's a behavior I would expect from ctrl-F4 but not from ctrl-4)
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #4 from Tavis Ormandy taviso@gmail.com --- No, it works fine. It can be bound in vim, i.e. imap <C-4> hello *does* insert the string hello.
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #5 from Eric Pouech eric.pouech@gmail.com --- and what's the content of log file after running WINEDEBUG=console ./wine cmd 2> log and hitting ctrl-4?
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #6 from Tavis Ormandy taviso@gmail.com --- Created attachment 73678 --> https://bugs.winehq.org/attachment.cgi?id=73678 debug log
Here is the log, only input is me pressing ctrl-4.
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #7 from Eric Pouech eric.pouech@gmail.com --- thanks for the log. it doesn't seem it's wine's console which terminates but the underlying terminal emulator
Ctrl-4 is read as character 'c', and likely since ctrl key is down, it's interpreted as ctrl-c (but not wine's conhost)...
what terminal emulator are you using ? and from a unix shell, is any character displayed when hitting ctrl-4 ?
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #8 from Tavis Ormandy taviso@gmail.com --- Just using regular xterm, but also tested in gnome-terminal.
No, no character displayed.
Oh - I see, if the application doesn't switch to application mode then it looks like quit to the terminal driver? If I run `stty quit undef` that does stop it from exiting, but I still can't bind it in the app.
I guess vim must do that on startup!
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #9 from Eric Pouech eric.pouech@gmail.com --- well the reason for exiting may be a bit complex than that
but: - from local testings: + on unix, ctrl character is only emitted for characters in ascii 0x40 - 0x5F (by shifting into 0x00 - 0x1F range) + it can be also supported for characters which are reported as control sequences (F1...) + in vim: ctrl-4 seems to be the same as ctrl-\ (from putting vi in insert mode, then 'ctrl-v ctrl-4' to seem the input chars) + you may have a different output
that means that from ./wine cmd.exe you will never get a real ctrl-4 binding
but, you will from ./wine wineconsole cmd.exe (as we get the input chars with all key sequences, including ctrl up/down)
I'd be interested in the ctrl-v ctrl-4 seq from vi to better understand why it crashes
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #10 from Tavis Ormandy taviso@gmail.com --- Do you have any stty in your .profile? As far as I know ^\ is the default binding for quit.
I see what you mean though - wine will have to choose whether ^4 or ^\ works, it cannot support both in in ncurses mode without terminal help - although as far as I know neither works right now!
https://bugs.winehq.org/show_bug.cgi?id=54141
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #11 from Fabian Maurer dark.shadow4@web.de --- Note sure this is a bug, ctrl-4 closes all applications for me when used in the terminal. According to https://unix.stackexchange.com/questions/226327/what-does-ctrl4-and-ctrl-do-... this results in SIGQUIT, and that does make sense to close Wine.
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #12 from Tavis Ormandy taviso@gmail.com --- Right, but it's technically possible to handle it, just like vim does.
If you're saying wine shouldn't, and that Windows console applications that use it will never work with wine... Okay, seems a shame though!
https://bugs.winehq.org/show_bug.cgi?id=54141
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #13 from Fabian Maurer dark.shadow4@web.de --- You mean there's windows console applications that have Ctrl-4 as some kind of hotkey? After thinking a bit about it, we should probably support that. After all, when you run bash in a zsh shell, it doesn't kill that either. Should be the same with cmd.
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #14 from Tavis Ormandy taviso@gmail.com --- Yep - I was trying to use Hiew (a hex editor), Ctrl-0 through Ctrl-9 are used for macros, and they can't be rebound to something else unfortunately!
https://bugs.winehq.org/show_bug.cgi?id=54141
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |eric.pouech@gmail.com
--- Comment #15 from Eric Pouech eric.pouech@gmail.com --- Created attachment 73681 --> https://bugs.winehq.org/attachment.cgi?id=73681 tentative patch
under this two assupmptions: - if your app does what I believe it does (using windows's console processed mode) - and if ctrl-4 generates ctrl-\ (terminal emulator) with this patch applied, your app should no longer close on ctrl-4
tentative patch: - move the ctrl-\ handling from unix to wine - add support for generating SIGQUIT in non processed-mode (ie ctrl-\ shall terminate ./wine cmd) - in process-mode, app should get the char events and not terminate
https://bugs.winehq.org/show_bug.cgi?id=54141
--- Comment #16 from Eric Pouech eric.pouech@gmail.com --- the commits fda954dfd4f1a0d07ca151324b9eaedc1f09964d and fda954dfd4f1a0d07ca151324b9eaedc1f09964d should prevent ctrl-\ to terminate the process in unix shell and processed mode
but I don't think we'll implement vim behavior for letting the user believe that ctrl-4 is actually defined on its own.
https://bugs.winehq.org/show_bug.cgi?id=54141
Julian RĂ¼ger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net