dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 892fa039ce87e559ab0a59112a349b7183bda26b
parent 113059f57c5d44c562cea90831aaf10150710b9f
Author: Ross Mohn <rpmohn@waxandwane.org>
Date:   Sun, 16 Dec 2012 13:54:46 +0100

vt: fix backspace handling on AIX

After forking a new pty on AIX set erase is wrongly set to ^H
instead of ^?.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
forkpty-aix.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/forkpty-aix.c b/forkpty-aix.c @@ -38,6 +38,7 @@ forkpty(int *master, char *name, struct termios *tio, struct winsize *ws) int slave, fd; char *path; pid_t pid; + struct termios tio2; if ((*master = open("/dev/ptc", O_RDWR|O_NOCTTY)) == -1) return (-1); @@ -76,7 +77,12 @@ forkpty(int *master, char *name, struct termios *tio, struct winsize *ws) fatal("open failed"); close(fd); - if (tio != NULL && tcsetattr(slave, TCSAFLUSH, tio) == -1) + if (tcgetattr(slave, &tio2) != 0) + fatal("tcgetattr failed"); + if (tio != NULL) + memcpy(tio2.c_cc, tio->c_cc, sizeof tio2.c_cc); + tio2.c_cc[VERASE] = '\177'; + if (tcsetattr(slave, TCSAFLUSH, &tio2) == -1) fatal("tcsetattr failed"); if (ioctl(slave, TIOCSWINSZ, ws) == -1) fatal("ioctl failed");