Commit graph

147 commits

Author SHA1 Message Date
Ray Lai
669713d43f 9term: Add missing parentheses, preventing buffer overflow.
(el-sr) is the string length and (sizeof wdir - strlen(name) - 20)
is the buffer size. When the string length is greater than the
buffer size, the beginning of the string is supposed to be trimmed
to fit in the buffer size. Unfortunately a pair of parentheses were
missing, pointing sr outside the buffer, and the for loop below
then reads outside the buffer. For certain binary data printed in
a window, it causes a segfault.

Change-Id: Iffeaa348260ee2a5a36d9577308fb8d1c1688d05
Reviewed-on: https://plan9port-review.googlesource.com/1540
Reviewed-by: Gleydson Soares <gsoares@gmail.com>
2017-04-08 00:04:32 +00:00
Russ Cox
c819ee640c 9term: c nits
Change-Id: Ia18ebb28f24bc69f404004896f9ce54ddb53faf9
Reviewed-on: https://plan9port-review.googlesource.com/2782
Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-09 15:44:30 +00:00
Dave Presotto
be7485e1da cmd/9term: A hack because I'm constantly getting confused about ^C vs fn+delete
Since Google (and a lot of the outside) is so engrained with using
^C as interrupt, I'd like to be able to use it in 9term if I've
stty'd my intr to ^C. Without this, hitting ^C still works but if
the program behind the window isn't reading from /dev/cons, it won't
take effect till after I hit a newline which is often very confusing.

I know this is a hack since it only works if I stty intr ^C but that
seems the only other character that gets used anyways.

Change-Id: I0597e63b2d7628f5668c648e6dba6f281e4b27fd
Reviewed-on: https://plan9port-review.googlesource.com/2742
Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-09 15:42:59 +00:00
Russ Cox
9e0d3750c5 9term, win: work around bsd linker nonsense
Change-Id: Ifcef0636ee1e1fd0f9b06a8d1a99d58fae831318
Reviewed-on: https://plan9port-review.googlesource.com/2780
Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-06 20:20:33 +00:00
Russ Cox
d296c18e37 9term, mc: conspire to handle hidpi displays
9term now uses the low bit of ws.ws_ypixel to signal
whether this is a hidpi display, and mc adjusts the font
it uses for columnation accordingly.

Makes 'lc' work right on hidpi displays.

Change-Id: I52928871ffb7f4c6fd6722f3d59f1836379148c6
Reviewed-on: https://plan9port-review.googlesource.com/2760
Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-06 15:36:59 +00:00
Russ Cox
8db40354c5 win: local \r cancellation
Change-Id: I4becec052af58c5a52b777004867eb23023b9403
Reviewed-on: https://plan9port-review.googlesource.com/1391
Reviewed-by: Russ Cox <rsc@google.com>
2015-11-10 15:34:42 +00:00
Russ Cox
0d2dfbc84f 9term, win: better \r handling (thanks, git)
Change-Id: I75563b911b54d8957d2d004b9c27d0a2f8f043b3
Reviewed-on: https://plan9port-review.googlesource.com/1390
Reviewed-by: Russ Cox <rsc@google.com>
2015-11-10 15:34:06 +00:00
Shenghou Ma
20035ed43c all: DragonFly port.
Fix compilation problems, libdraw still doesn't work right yet.

LGTM=rsc
R=rsc
https://codereview.appspot.com/67820046
2014-02-27 23:17:47 -05:00
Russ Cox
bf63f986ff 9term: set TERM=dumb instead of TERM=9term
Everyone seems to assume that TERM != dumb implies
ANSI escape codes are okay. In fact, many people assume
that unconditionally, but it is easier to argue back about
TERM=dumb than TERM=9term.

This applies to acme win too, because they share the code.

Set termprog=9term or termprog=win for clients who
need to know.

R=rsc
CC=r
https://codereview.appspot.com/12532043
2013-08-06 09:42:10 -04:00
Russ Cox
a8a0a6422c 9term: adjust to dpi changes
R=rsc
http://codereview.appspot.com/6847105
2012-11-26 00:13:18 -05:00
Russ Cox
f1825251e7 9term: fix hold mode delay 2011-10-13 09:38:24 -04:00
Russ Cox
210d461c87 merge 2011-10-12 13:19:04 -04:00
Russ Cox
0e881c054a 9term: hold mode back door
R=rsc
http://codereview.appspot.com/5248056
2011-10-11 09:34:25 -04:00
David Swasey
53000799be 9term: fix insert
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4952066
2011-09-12 12:36:30 -04:00
Mathieu Lonjaret
13666ca73e win: hide not just passwords but also passphrases
R=rsc, nicolesimons1986
CC=plan9port.codebot
http://codereview.appspot.com/4957042
2011-08-26 16:40:04 -04:00
Russ Cox
65a5e5fe46 9term: home/end like acme
R=rsc
http://codereview.appspot.com/4830052
2011-08-02 07:55:20 -04:00
Russ Cox
ba31ab3044 9term, acme: autoscroll
Ignore scroll/noscroll window setting.
Instead, scroll when the write begins in
or immediately after the displayed window content.

In the new scrolling discipline, executing
"Noscroll" is replaced by typing Page Up or
using the mouse to scroll higher in the buffer,
and executing "Scroll" is replaced by typing End
or using the mouse to scroll to the bottom of
the buffer.

R=r, r2
http://codereview.appspot.com/4433060
2011-04-27 13:18:07 -04:00
Russ Cox
c8471ac58c win: another attempt at input modes
R=rsc
http://codereview.appspot.com/2476042
2010-10-13 10:50:46 -04:00
Russ Cox
875351f44f win: add cook/nocook
R=rsc
http://codereview.appspot.com/2162042
2010-09-10 09:31:56 -04:00
Russ Cox
ef5c6a6eda 9term, win: better echo cancellation
Also just drop \r from output.
It's a losing battle to keep turning it off.

R=rsc
http://codereview.appspot.com/2128042
2010-09-03 10:21:16 -04:00
Anthony Martin
c988c8adf1 9term: fix getpts on linux
Openpty uses grantpt internally and its behavior is
unspecified when a handler is set to catch SIGCHLD.

Fixes issue 37. http://code.swtch.com/plan9port/issues/37

R=rsc
CC=codebot
http://codereview.appspot.com/1209049
2010-06-28 14:32:29 -07:00
David Swasey
670f730113 9term: add -c to force cooked mode
R=rsc
CC=codebot
http://codereview.appspot.com/1044043
2010-05-19 18:27:05 -07:00
David Swasey
7b08cf334b 9term: cut, snarf, and paste with keyboard on Mac
R=rsc
CC=codebot
http://codereview.appspot.com/854042
2010-04-13 13:16:36 -07:00
Eoghan Sherry
bea7c49aad win: scroll
R=rsc
CC=codebot
http://codereview.appspot.com/643041
2010-03-19 13:10:14 -07:00
Fazlul Shahriar
6a6c2663bf win fixes
- don't exit from a "child" note unless rc exited (code copied from 9term.c)
- ignore writes to the tag; specifically " Send Noscroll" at startup.

R=rsc
CC=codebot
http://codereview.appspot.com/181115
2010-01-05 14:31:27 -08:00
Russ Cox
0cadb4301d convert to 4-byte UTF-8 and 32-bit Rune
http://codereview.appspot.com/116075
2009-09-11 17:03:06 -04:00
Tony Lainson
3b7ca01f98 9term: allow scroll wheel in main window
http://codereview.appspot.com/105082
2009-08-11 11:11:58 -04:00
Russ Cox
77ac358321 merge 2009-06-09 09:26:13 -07:00
Russ Cox
65a34c7fac win: better SIGPIPE handling 2009-01-06 14:42:41 -08:00
Russ Cox
95cb0f633d win: another attempt at DEL 2008-11-13 18:21:10 -08:00
Russ Cox
d66973d28e win: handle DEL internally so that it always works 2008-11-13 15:49:48 -08:00
Russ Cox
e1118cf27c win: implement Scroll and Noscroll 2008-11-13 15:39:56 -08:00
Russ Cox
482299b83c 9term: convert to new libframe 2008-07-21 12:32:45 -04:00
rsc
adcb656c84 correct dump string (Fazlul Shahriar) 2007-04-17 05:43:22 +00:00
rsc
93921c4817 better cleanup 2006-06-28 17:39:52 +00:00
rsc
98df7c80d8 check initdraw return 2006-06-25 23:50:32 +00:00
rsc
96e0eb83dd more matching (eq) 2006-04-01 21:28:43 +00:00
rsc
cbeb0b26e4 Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
rsc
dcf4d596ca antialias redraw 2006-03-30 13:00:27 +00:00
rsc
0aa79278fa quiet Del in win 2006-03-27 13:06:15 +00:00
rsc
89de2e575e ignore hangup signal 2006-01-19 00:05:56 +00:00
rsc
5bd21066c5 different login shell 2006-01-18 23:11:00 +00:00
rsc
8a6837e8c0 back to -i 2006-01-18 23:05:38 +00:00
rsc
f729f79ca2 login shell 2006-01-18 00:59:05 +00:00
rsc
7fe619f766 use STACK 2005-12-29 22:11:35 +00:00
rsc
e58459c7b3 fix paste in raw hold mode 2005-12-29 21:15:06 +00:00
rsc
baa6e34b72 set window params on startup 2005-11-30 02:31:55 +00:00
rsc
430976597f OS X fix 2005-11-27 15:56:23 +00:00
rsc
540eaf9828 fix \r 2005-11-26 15:53:37 +00:00
rsc
d879e173b4 add button 3 menu 2005-11-26 15:42:53 +00:00