[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[screen-devel] [bug #48339] Default settings of termios parameters (VKIL
From: |
Valentin Nechayev |
Subject: |
[screen-devel] [bug #48339] Default settings of termios parameters (VKILL, etc.) are ugly |
Date: |
Wed, 29 Jun 2016 09:06:15 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0 |
URL:
<http://savannah.gnu.org/bugs/?48339>
Summary: Default settings of termios parameters (VKILL, etc.)
are ugly
Project: GNU Screen
Submitted by: netch
Submitted on: Wed 29 Jun 2016 09:06:13 AM GMT
Category: Program Logic
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: Cur Dev Sources
Fixed Release: None
Planned Release: None
Work Required: None
_______________________________________________________
Details:
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)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48339>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [screen-devel] [bug #48339] Default settings of termios parameters (VKILL, etc.) are ugly,
Valentin Nechayev <=