Ticket #3164 (new bug)

Opened 7 weeks ago

Last modified 6 weeks ago

Bug in terminal when using curses app over ssh

Reported by: noisetonepause Owned by: jackburton
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1 development
Cc: Blocked By:
Platform: All Blocking:

Description

I'm filing this as a bug in Terminal, though I think this is related to termios.h.

If you look at the screenshots, you'll see the curses app silc-client running over an SSH connection from my friend's FreeBSD machine. Silc-client is based on irssi, so shouuld be familiar. It's basically a irc-like chat application. The line below the blue line is an input field. I type some input and press enter. As can be seen from the second screenshot, all the text is then moved up a line, including my text from the input box (which you'd expect to be erased). The line is written to the where'd you expect it to go on the first screenshot (ie., first empty line).

Incoming text from the server and other chatters works fine. Cycling through the 'windows' in the client redraws the text as you'd expect. The only problem is when inputting text.

The screenshots are from BeOS but the exact same thing happens in Haiku. An xterm running under BeOS/X11 does not have this issue, though.

I've compared the termios.h headers from Haiku, BeOS and Free+OpenBSD, and BeOS defines VKILL and VEOL opposite. What I think is happening is that silc-client, which is linked against BSD's libcurses, is sending what's defined as VKILL on BSD to the Haiku terminal app, which is interpreting it as VEOL. That seems consistent with the issue, at least.

Attachments

silc.png (10.3 KB) - added by noisetonepause 7 weeks ago.
1st screenshot
borkd.png (10.3 KB) - added by noisetonepause 7 weeks ago.
2nd screenshot

Change History

Changed 7 weeks ago by noisetonepause

1st screenshot

Changed 7 weeks ago by noisetonepause

2nd screenshot

  Changed 7 weeks ago by noisetonepause

I tried swapping the definitions of VKILL and VEOL in headers/posix/termios.h and recompiling, but that it's the same... still digging, would appreciate pointers!

follow-up: ↓ 3   Changed 7 weeks ago by bonefish

Unfortunately Trac doesn't let me see the attachments. *sigh*

The V* macros are just indices into termios::c_cc. I doubt that the termios structure or the indices are ever sent over the ssh connection. Or if they are, I'm pretty sure the OpenSSH authors have considered that those indices can differ (they are also different in Linux). I wouldn't expect the problem there.

It is more likely that certain xterm features are used that Haiku's Terminal doesn't support yet. Or, of course, there might still be bugs in the supported features.

in reply to: ↑ 2   Changed 7 weeks ago by noisetonepause

Comment(by bonefish): Unfortunately Trac doesn't let me see the attachments. *sigh*

The screenshots are also at nisbeth.dk/niklas/silc.png and nisbeth.dk/niklas/borkd.png.

If anyone wants to experience it first hand, that can probably be arranged.

The V* macros are just indices into termios::c_cc. I doubt that the termios structure or the indices are ever sent over the ssh connection. Or if they are, I'm pretty sure the OpenSSH authors have considered that those indices can differ (they are also different in Linux). I wouldn't expect the problem there.

No, you really wouldn't, but the symptoms fit perfectly (a newline instead of a kill). I've no real idea about exactly how curses apps interact with the terminal, but I don't think SSH comes into play? Isn't SSH just a transport?

I'm trying to dig up as much documentation on this stuff as I can. Happily enough, that "Porting UNIX Applications" book which I bought thinking I'd never use it for anything provided me a few good starting points...

It is more likely that certain xterm features are used that Haiku's Terminal doesn't support yet. Or, of course, there might still be bugs in the supported features.

I was afraid you'd say that. I'm hoping there's some way around debugging it that doesn't involve going learning the gritty details of all the involved software, but I can't really think of anything. More digging, I suppose.

  Changed 7 weeks ago by noisetonepause

Now this I wasn't expecting:

When I run Haiku in QEMU and telnet to the host OS (FreeBSD), silc-client works flawlessly.

Odd. Very odd?

follow-up: ↓ 6   Changed 6 weeks ago by jackburton

Could depend on the keymap ? Qemu by default emulates an US keymap.

in reply to: ↑ 5   Changed 6 weeks ago by noisetonepause

Replying to jackburton:

Could depend on the keymap ? Qemu by default emulates an US keymap.

Ah, you misunderstand - it would appear that SSH is the problem, as it works over Telnet but now SSH.

Note: See TracTickets for help on using tickets.