Some crazy guy decided to set VERASE to DEL by default in the kernel. So
when starting an application which does not initialize the terminal on
startup, they may not notice that we actually send BACKSPACE as
erase-character (like /bin/login). Therefore, initialize VERASE to 010 so
everyone is happy.
Thanks to Etam for reporting this!
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
pid_t pid;
char slave_name[128];
int slave = -1;
+ struct termios attr;
/* The child should not inherit our signal mask. */
sigemptyset(&sigset);
goto err_out;
}
+ /* get terminal attributes */
+ if (tcgetattr(slave, &attr) < 0) {
+ log_err("cannot get terminal attributes: %m");
+ goto err_out;
+ }
+
+ /* erase character should be normal backspace */
+ attr.c_cc[VERASE] = 010;
+
+ /* set changed terminal attributes */
+ if (tcsetattr(slave, TCSANOW, &attr) < 0) {
+ log_warn("cannot set terminal attributes: %m");
+ goto err_out;
+ }
+
if (ws) {
ret = ioctl(slave, TIOCSWINSZ, ws);
if (ret)