JohnForecast / LinuxDECnet

DECnet as an external module for Linux
9 stars 0 forks source link

dnlogin/sethost terminal misbehavings #5

Closed jayjwa closed 7 months ago

jayjwa commented 7 months ago

Though I've seen this behavior for awhile, I've been hesitant to report it as I was not sure it was a local issue or not. Now, with 4 ways (telnet, rlogin, LAT, dnlogin/sethost) to remote login to a VMS node, I think I can say with some degree of certainty something is off with dnlogin/sethost's terminal handling. This behavior is noticeable with various utilities, such as Kermit, MAIL, the edit/tpu (EVE) editor, or even (see test at the end) CREATE.

Consider a correctly working terminal via TELNET:

$ show term
Terminal: _TNA3:      Device_Type: VT100         Owner: JAYJWA
Remote Port Info: Host: atr2.lan Port: 34088

   Input:    9600     LFfill:  0      Width:  80      Parity: None
   Output:   9600     CRfill:  0      Page:   23      

Terminal Characteristics:
   Interactive        Echo               Type_ahead         No Escape
   No Hostsync        TTsync             Lowercase          Tab
   Wrap               Scope              No Remote          No Eightbit
   Broadcast          No Readsync        No Form            Fulldup
   No Modem           No Local_echo      No Autobaud        Hangup
   No Brdcstmbx       No DMA             No Altypeahd       Set_speed
   No Commsync        Line Editing       Insert editing     No Fallback
   No Dialup          No Secure server   No Disconnect      No Pasthru
   No Syspassword     No SIXEL Graphics  No Soft Characters No Printer Port
   Numeric Keypad     ANSI_CRT           No Regis           No Block_mode
   Advanced_video     No Edit_mode       DEC_CRT            No DEC_CRT2
   No DEC_CRT3        No DEC_CRT4        No DEC_CRT5        No Ansi_Color
   VMS Style Input

A correctly working terminal via llogin (LAT):

$ show term
Terminal: _LTA5007:   Device_Type: VT100         Owner: JAYJWA
LAT Server/Port: ATR2//dev/pts/11

   Input:    9600     LFfill:  0      Width:  80      Parity: None
   Output:   9600     CRfill:  0      Page:   23      

Terminal Characteristics:
   Interactive        Echo               Type_ahead         No Escape
   No Hostsync        TTsync             Lowercase          Tab
   Wrap               Scope              No Remote          No Eightbit
   Broadcast          No Readsync        No Form            Fulldup
   No Modem           No Local_echo      No Autobaud        Hangup
   No Brdcstmbx       No DMA             No Altypeahd       Set_speed
   No Commsync        Line Editing       Insert editing     No Fallback
   No Dialup          No Secure server   No Disconnect      No Pasthru
   No Syspassword     No SIXEL Graphics  No Soft Characters No Printer Port
   Numeric Keypad     ANSI_CRT           No Regis           No Block_mode
   Advanced_video     No Edit_mode       DEC_CRT            No DEC_CRT2
   No DEC_CRT3        No DEC_CRT4        No DEC_CRT5        No Ansi_Color
   VMS Style Input

Rlogin is similar to the above two (example omitted for brevity). Dnlogin session with terminal problems:

$ show term
Terminal: _RTA1:      Device_Type: VT200_Series  Owner: JAYJWA
Remote Port Info: ATR2::Linux0000

   Input:    9600     LFfill:  0      Width:  80      Parity: None
   Output:   9600     CRfill:  0      Page:   23      

Terminal Characteristics:
   Interactive        Echo               Type_ahead         No Escape
   No Hostsync        TTsync             Lowercase          Tab
   Wrap               Scope              No Remote          Eightbit
   Broadcast          No Readsync        No Form            Fulldup
   No Modem           No Local_echo      No Autobaud        No Hangup
   No Brdcstmbx       No DMA             No Altypeahd       Set_speed
   No Commsync        Line Editing       Insert editing     No Fallback
   No Dialup          No Secure server   No Disconnect      No Pasthru
   No Syspassword     No SIXEL Graphics  No Soft Characters No Printer Port
   Numeric Keypad     ANSI_CRT           No Regis           No Block_mode
   Advanced_video     No Edit_mode       DEC_CRT            No DEC_CRT2
   No DEC_CRT3        No DEC_CRT4        No DEC_CRT5        No Ansi_Color
   VMS Style Input

$ eve linetest.txt

                                                      ;H[End of file]K22;H;7m Buffer: LINETEST.TXT                                | Write | Insert | Forward m
KK22A

Properly working mail editing via rlogin session (note lines):

$ mail

MAIL> send             
To:     atr2::jayjwa
Subj:   Mail from rlogin session
Enter your message below. Press CTRL/Z when complete, or CTRL/C to quit:
Line one.
Line two.
Line three.
 Exit 

MAIL>

dnlogin mail session keeps overwriting message space (note "Line three"):

$ mail

MAIL> send
To:     atr2::jayjwa
Subj:   Testing mail from dnlogin session
Line three.message below. Press CTRL/Z when complete, or CTRL/C to quit:

MAIL>

It is not possible to change the term type to vt100 like the working examples:

$ set term /device_type=VT100
$ show term
Terminal: _RTA1:      Device_Type: VT200_Series  Owner: JAYJWA
Remote Port Info: ATR2::Linux0000

Strange behavior with Kermit, via dnlogin, not present with LAT login (note echos): DUA1:[JAYJWA] C-Kermit>sshhooww vveerrssiioonn

The easiest way to test this is likely with CREATE. xterm VAX 5.5 dnlogin:

$ create dnlinetest.txt
Line three.linetest.txt

$ type dnlinetest.txt  
Line one.
Line two.
Line three.

xterm VAX 5.5 llogin (LAT):

$ create lllinetest.txt
Line one.
Line two.
Line three.
 Exit 

$ type lllinetest.txt
Line one.
Line two.
Line three.

xterm dnlogin VAX 7.3:

$ create dnlinetest.txt
Line three.nlinetest.txt

$ type dnlinetest.txt
Line one.
Line two.
Line three.

xterm telnet VAX 7.3:

$ create tlinetest.txt
Line one.
Line two.
Line three.
 Exit 

$ type tlinetest.txt
Line one.
Line two.
Line three.

All tests from the same UXterm ( xterm -class UXTerm -u8 -fg bisque1 -bg black -fn -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1 -bc +ai -132 +cm -j -kt vt220 +mesg +si) (TERM=xterm) and Tmux (TERM=sixel-tmux). The same behavior occurs with no Tmux. While Xterm is most likely the most "DECnet friendly", the same occurs with Urxvt (TERM=rxvt-unicode), or even just "xterm" (TERM=xterm).

JohnForecast commented 7 months ago

Can you try running the same tests with "-d 22" on the command line? This will generate a log of cterm commands and tty operations on standard error. I'm most interested in the overwritten lines in the file create test and extra echoes with C-Kermit.

The failure to change terminal type is because dnlogin explicitly disables such changes. I'll have to check the spec to see what it would take to enable such changes.

jayjwa commented 7 months ago

dnlogin -d 22 lunast 2> dnterm.log I snipped the actual password key sequence. Hopefully that's OK. Line creation test as before, Kermit 'show version'. dnterm.log

JohnForecast commented 7 months ago

The latest version of dnprogs/dnlogin/cterm.c should fix the double echoing seen with c-kermit. Still working on the line overwriting issue.

jayjwa commented 7 months ago

Extra echos seems to be fixed.

JohnForecast commented 7 months ago

I believe the latest code should fix the line overwriting issue (cterm.c, dnlogin.h, found.c and tty.c). This version will no longer claim to be a VMS system, instead using a customer reswerved value (193). This works OK for VMS but may cause problems with other systems.

jayjwa commented 7 months ago

That will do it. Thank you.