diff options
author | rsc <devnull@localhost> | 2005-02-08 18:33:06 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-02-08 18:33:06 +0000 |
commit | 8d9f61e1c98c0513358585d3c4a31236b3e3189c (patch) | |
tree | 38bf88778446638ea7f4bb436f91b79514b43c67 /src/cmd | |
parent | dc305d03681e150b97acf4631a514868acd4b276 (diff) | |
download | plan9port-8d9f61e1c98c0513358585d3c4a31236b3e3189c.tar.gz plan9port-8d9f61e1c98c0513358585d3c4a31236b3e3189c.tar.bz2 plan9port-8d9f61e1c98c0513358585d3c4a31236b3e3189c.zip |
try to handle DEL better
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/9term/9term.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index f22bebc5..22dddc73 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -913,37 +913,36 @@ key(Rune r) paste(t.snarf, t.nsnarf, 0); if(scrolling) show(t.q0); + consread(); return; } - switch(r) { - /* case 0x03: can't do this because ^C is COPY */ - case 0x7F: /* DEL: send interrupt */ - paste(&r, 1, 1); - t.qh = t.q0 = t.q1 = t.nr; - show(t.q0); - /* must write the interrupt character in case app is in raw mode (e.g., ssh) */ - write(rcfd, "\x7F", 1); - // postnote(PNGROUP, rcpid, "interrupt"); + if(rawon() && t.q0 == t.nr){ + addraw(&r, 1); + consread(); return; } - if(rawon() && t.q0==t.nr){ - addraw(&r, 1); - consread(); + if(r == 0x7F){ /* DEL: send interrupt; what a mess */ + if(holdon){ + holdon = 0; + drawhold(holdon); + } + t.qh = t.q0 = t.q1 = t.nr; + show(t.q0); + write(rcfd, "\x7F", 1); return; } - if(r==ESC || (holdon && r==0x7F)){ /* toggle hold */ + if(r==ESC){ /* toggle hold */ holdon = !holdon; drawhold(holdon); - // replaceintegerproperty("_9WM_HOLD_MODE", 1, 32, holdon); + /* replaceintegerproperty("_9WM_HOLD_MODE", 1, 32, holdon); */ if(!holdon) consread(); - if(r==ESC) - return; + return; } - + snarf(); switch(r) { |