http://bugs.winehq.org/show_bug.cgi?id=24306
Summary: kernel/console: no more EOF handling. Product: Wine Version: 1.3.2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wineserver AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net CC: eric.pouech@orange.fr
Hi,
^D (^Z in native) used to be able to end the session with my interactive MCI shell (bug #20232, comment #9). What it does is:
HANDLE hin = GetStdHandle(STD_INPUT_HANDLE); ret = ReadFile(hin, inbuf, sizeof(inbuf)/sizeof(inbuf[0])-1, &received, NULL); if(!ret || !received) break;
^D signals EOF in UNIX (more precisely, it immediately returns the pending read(), which is interpreted as EOF when there is no more input on the line). ^Z is EOF in MS-Windows, since MS-DOS times.
Presumably since Eric Pouech's console patches, EOF is not recognized and I must ^C the program.
BTW, native's ^Z handling differs among versions. In win95, ^Z immediately sends an EOF to the app; since w2k you need ^Z + Return.
^Z is not honoured in Wine (after using "stty susp ^y").
Alternatively instead of wine mcishell.exe, using ^C in an mcishell started inside "wine cmd" yields: ^Cfixme:console:CONSOLE_DefaultHandler Terminating process 8 on event 0 fixme:console:CONSOLE_DefaultHandler Terminating process 1c on event 0 err:console:WCEL_Get hmm bad situation mci.c:1376hoehle:~/Bugs$ : GetLastError: 0 <= that's from mcishell, so it was not aborted!?! ^^^^^^^^^^^^^^ bash prompt gets in between mcishell: 2 tests executed (0 marked as todo, 1 fai <= nothing more
I just noticed console error #2: wine wineconsole cmd (as the usage() text says) opens a virtual desktop but no console window appears. That desktop window cannot be activated. Clicking the close button produces Wine's "kill app" requester after a couple of seconds. Accepting yields a mini backtrace in the terminal: 0x9d50fd0:1: Fd unix_fd=71 user=0x9db3320 options=00000020 0x9db3320:1: Console screen buffer input=0x9d53fe0 0x9d50f10:1: Fd unix_fd=65 user=0x9d53fe0 options=00000020 0x9d598a0:1: Event manual=1 signaled=0 name="" 0x9d53fe0:1: Console input active=0x9db3320 evt=(nil) That does not look like a typical backtrace from Wine. Ah, it's from server/{event,console}.c I should probably open a separate bug report for that one.
I'm using Ubuntu Intrepid.
http://bugs.winehq.org/show_bug.cgi?id=24306
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
--- Comment #1 from Jerome Leclanche adys.wh@gmail.com 2010-09-08 00:54:13 CDT --- Possible dupe of bug 20842 but I haven't retested the app yet.
http://bugs.winehq.org/show_bug.cgi?id=24306
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression, source
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2010-09-08 04:54:34 CDT --- It cannot be a dupe of something that old. It's a brand new regression and EOF handling is not covered by the latest overview of issues in wine-devel: http://www.winehq.org/pipermail/wine-devel/2010-September/086510.html
http://bugs.winehq.org/show_bug.cgi?id=24306
--- Comment #3 from Jörg Höhle hoehle@users.sourceforge.net 2010-12-03 16:24:36 CST --- Eric, I tested your past-1.3.38 commit ead4712606307bf92525e9aad1374a2cc0bc8fc0 It's not entirely satisfactory yet. Using wine wintest.exe mcishell
1. In a UNIX terminal, ^Z conflicts with SIGSTOP Using "stty susp ^y" to map that to ^Y however allows to exit the app via EOF. Good work!
2. Control characters are echoed to the terminal, printing (in Gnome-terminal) weird squares with hex code in it to the screen. Likewise, white squares appear when running wine wineconsole mcishell.exe This must be related to your commit 9c577630d11cd19273b93eeb6295c0b2b75fa42b This is not what the user expects to see, neither on UNIX or MS-Windows. Perhaps running a shell within Emacs on XP would allow to guess whether control characters are echoed and simply not printed visibly in a MS-Windows console.
It's not clear to me why you resort to raw mode. Apps using ReadLine() get the standard cmd.exe aka. DOSEdit line editing, which is equivalent to cooked mode on UNIX IMHO. DOSEdit may provide more useful editing thanks to the command history, but that's a feature of the cooked line editor, not the application. I've read something similar can be achieved in UNIX using the rlwrap or rlfe packages: they enhance the cooked mode with history.
3. Using the arrow keys in a gnome terminal produce weird effects. It looks like two things happen: squares are printed *and* the cursor moves one line!
http://bugs.winehq.org/show_bug.cgi?id=24306
--- Comment #4 from Jörg Höhle hoehle@users.sourceforge.net 2010-12-03 16:28:54 CST --- Created an attachment (id=32342) --> (http://bugs.winehq.org/attachment.cgi?id=32342) gnome-terminal flooded with control codes as cursor moves through screen
I attached a screenshot as it remembers me of the old snake / Tron games. I simply ran wine wintest.exe mcishell and used the arrow keys. Using Ubuntu Lucid.
http://bugs.winehq.org/show_bug.cgi?id=24306
--- Comment #5 from Eric Pouech eric.pouech@orange.fr 2010-12-16 15:04:17 CST --- should be fixed by now please retest A+
http://bugs.winehq.org/show_bug.cgi?id=24306
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2011-01-11 14:03:06 CST --- Looks good in 1.3.10. Control characters are echoed to the Gnome terminal, which is fine with me. Both ^C and ^Z work (after stty susp ^Y).
What's different from native is behaviour when ^D is not at the beginning of line, e.g. type "abc^D" resp. "abc^Z". This might make a difference with apps that read from a redirected file (or inside a shell buffer in Emacs) but I have no such use case.
What's not perfect yet is echoing after a program is suspended and restarted. Bash will have changed terminal mode in between, causing all subsequent input to Wine to be echoed twice to the console (the full line of input is printed again after pressing Return). I don't know whether detecting SIGSTOP/SIGCONT in order to set again the terminal parameters would help. Luckily, ^D still works after suspend/fg. Thank you!
http://bugs.winehq.org/show_bug.cgi?id=24306
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org 2011-01-21 13:44:20 CST --- Closing bugs fixed in 1.3.12.