Opened 11 years ago

Closed 11 years ago

#2533 closed bug (fixed)

Terminal drops ^D

Reported by: donn Owned by: jackburton
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Terminal ignores <ctrl>D, so it's difficult to exit command line applications that expect EOF, for example Python interpreter.

Apparently, because TermView::KeyDown() partially confuses this input with B_END, whose value is also 0x4. But rawChar != B_END, so eventually it's just not handled by that case branch, and in the nothing comes out because it didn't go through the default case.

The behavior can be fixed by adding an else {} clause, in the B_END branch, similar to the default branch, but that seems like kind of a band-aid. <ctrl>D should probably not match B_END.

Change History (2)

comment:1 Changed 11 years ago by donn

Note that other character values may be broken here. For example, <ctrl>\ matches B_LEFT_ARROW. I would suggest you dispatch off rawChar rather than *bytes in that big case expression, since most branches follow the same logic and have the same problem. The "if (rawChar == " test can then be omitted from each of those branches. I also omitted the test for <ctrl>H, which looks like a mistake to me.

That works for me: it fixes a handful of broken control characters, and doesn't break anything I expected to work. Something might need to be done for keypad keys, though, as I seem to have lost the numeric keypad.

comment:2 Changed 11 years ago by bonefish

Resolution: fixed
Status: newclosed

Fixed in hrev26550.

Note: See TracTickets for help on using tickets.