bugGNU Screen - Bugs: bug #48339, Default settings of termios...

 
 

bug #48339: Default settings of termios parameters (VKILL, etc.) are ugly

Submitted by:  Valentin Nechayev <netch>
Submitted on:  Wed 29 Jun 2016 09:06:13 AM UTC  
 
Category: Program LogicSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: Cur Dev Sources
Fixed Release: 4.5.0Planned Release: None
Work Required: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 04 Jul 2016 06:34:33 PM UTC, comment #2:

Nice find, thanks. Hopefully fixes weird issues that people were experiencing sometimes while starting detached sessions.

Pushed changes to screen-v4 & master.

Amadeusz Sławiński <amade>
Project Administrator
Wed 29 Jun 2016 01:34:38 PM UTC, comment #1:

Minor fixup: s/_POSIX_VDISABLE/VDISABLE/
the latter is already present in os.h and used in neighbor places.

Valentin Nechayev <netch>
Wed 29 Jun 2016 09:06:13 AM UTC, original submission:

There are three issues in the same code chunk so I prefer to note them together.

I. InitTTY() in tty.c currently has (in master branch):

#if defined(VKILL)
#if (VKILL < MAXCC)
m->tio.c_cc[VKILL] = Ctrl('H');
#endif

All other settings look reasonable but Ctrl+H for VKILL is strongly weird because the default for the thorough Unix life is Ctrl+U.

This value is copied from pre-Git times, reasoning isn't known, so I suggest this is typo going from times of battle between two Backspace styles.

This affects terminals created in initially detached mode, with command like "screen -c $config -dm" and config lines like

screen -t proxy 0
stuff "~/utils/gasket proxy\n"

the created terminal is badly controllable.

Fix is trivial:

diff --git a/src/tty.c b/src/tty.c
index 585e0f50..d50486f7 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -272,7 +272,7 @@ void InitTTY(struct mode *m, int ttyflag)
#endif /* VERASE */
#if defined(VKILL)
#if (VKILL < MAXCC)
- m->tio.c_cc[VKILL] = Ctrl('H');
+ m->tio.c_cc[VKILL] = Ctrl('U');
#endif
#endif /* VKILL */
#if defined(VEOF)

II. Also, such terminals get VMIN=0, despite tty.c code sets TTYVMIN to 1 and then sets VMIN to TTYVMIN.

III. For some parameters, it sets values to 0 in context where they supposed to be disabled:

#if defined(VEOL)
#if (VEOL < MAXCC)
m->tio.c_cc[VEOL] = 0000;
#endif

the same for VEOL2, VSWTCH. But, 0 is "disable" at Linux and some other flavors, but not BSD group.

Suggested fix:

diff --git a/src/tty.c b/src/tty.c
index 585e0f50..48af30a6 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -47,6 +47,10 @@
#include "telnet.h"
#include "tty.h"

+#ifndef _POSIX_VDISABLE
+#define _POSIX_VDISABLE 0000
+#endif
+
static void consredir_readev_fn(Event , void );

bool separate_sids = true;
@@ -282,17 +286,17 @@ void InitTTY(struct mode *m, int ttyflag)
#endif /* VEOF */
#if defined(VEOL)
#if (VEOL < MAXCC)
- m->tio.c_cc[VEOL] = 0000;
+ m->tio.c_cc[VEOL] = _POSIX_VDISABLE;
#endif
#endif /* VEOL */
#if defined(VEOL2)
#if (VEOL2 < MAXCC)
- m->tio.c_cc[VEOL2] = 0000;
+ m->tio.c_cc[VEOL2] = _POSIX_VDISABLE;
#endif
#endif /* VEOL2 */
#if defined(VSWTCH)
#if (VSWTCH < MAXCC)
- m->tio.c_cc[VSWTCH] = 0000;
+ m->tio.c_cc[VSWTCH] = _POSIX_VDISABLE;
#endif
#endif /* VSWTCH */
#if defined(VSTART)

Valentin Nechayev <netch>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by amade (Posted a comment)
  • -unavailable- added by netch (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 18 Jan 2017 09:45:10 PM UTCamadeOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.0
    Mon 04 Jul 2016 06:34:33 PM UTCamadeStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1