Commit Graph

1137 Commits

Author SHA1 Message Date
Amadeusz Sławiński
4fc50b943b stop using key argument in quit command handler
adds  quit --command  as alternative way to call quit command and
binds  C-a C-\  to call it
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
506477bf85 stop using key argument in kill command handler
adds  kill --command  as alternative way to call kill command and
binds  C-a k  and  C-a C-k  to call it
2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
6461828e34 remove no longer used variables in DoAction 2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
461f0ad0c4 refactor DoAction switch into calling functions
after everything is finished goals are:
* to have table of callbacks to search from and call
* commands to have (char **argv, int argc) in declaration

refactor RC_SELECT into separate function call
refactor RC_MULTIINPUT into separate function call
  also fix some logic while at it
refactor RC_DEFAUTONUKE & RC_AUTONUKE into separate function calls
refactor RC_DEFOBUFLIMIT & RC_OBUFLIMIT into separate function calls
refactor RC_DUMPTERMCAP into separate function call
refactor RC_HARDCOPY into separate function call
refactor RC_DEFLOG & RC_LOG into separate function calls
refactor RC_SUSPEND into separate function calls
refactor RC_PREV & RC_NEXT into separate function calls
refactor RC_KILL into separate function call
refactor RC_QUIT into separate function call
refactor RC_DETACH & RC_POW_DETACH into separate function calls
refactor RC_ZMODEM into separate function call
refactor RC_UNBINDALL into separate function call
refactor RC_ZOMBIE into separate function call
refactor RC_WALL into separate function call
refactor RC_AT into separate function call
refactor RC_READREG into separate function call
refactor RC_REGISTER into separate function call
refactor RC_PROCESS into separate function call
refactor RC_STUFF into separate function call
refactor RC_REDISPLAY into separate function call
refactor RC_WINDOWS inte separate function call
refactor RC_VERSION into separate function call
remove RC_TIME
  should've done this when removing time and loadavg escapes
refactor RC_INFO into separate function call
refactor RC_DINFO into separate function call
refactor RC_COMMAND into separate function call
refactor RC_OTHER into separate function call
refactor RC_META into separate function call
refactor RC_XON & RC_XOFF into separate function calls
refactor RC_BREAKTYPE & RC_DEFBREAKTYPE into separate functions calls
  something to check:
  according to documentation they should have bit different behaviour,
  but are all one single call...
refactor RC_BREAK & RC_POW_BREAK into separate function calls
refactor RC_LOCKSCREEN into separate function call
refactor RC_WIDTH & RC_HEIGHT into separate function calls
refactor RC_DEFDYNAMICTITLE & RC_DYNAMICTITLE into separate function calls
refactor RC_TITLE into separate function call
refactor RC_COLON into separate function call
refactor RC_LASTMSG into separate function call
refactor RC_SCREEN into separate function call
refactor RC_WRAP into separate function call
refactor RC_FLOW into separate function call
refactor RC_DEFWRITELOCK & RC_WRITELOCK into separate function calls
refactor RC_CLEAR into separate function call
refactor RC_RESET into separate function call
refactor RC_MONITOR into separate function call
refactor RC_DISPLAYS into separate function call
refactor RC_WINDOWLIST into separate function call
refactor RC_HELP into separate function call
refactor RC_LICENSE into separate function call
refactor RC_COPY into separate function call
refactor RC_HISTORY & RC_PASTE into separate function calls
refactor RC_READBUF & RC_WRITEBUF into separate function calls
refactor RC_REMOVEBUF into separate function call
refactor RC_IGNORECASE into separate function call
refactor RC_DEFESCAPE & RC_ESCAPE into separate function calls
refactor RC_CHDIR into separate function call
refactor RC_DEFSHELL & RC_SHELL into separate function call
refactor RC_HARDCOPYDIR into separate function call
refactor RC_LOGFILE into separate function call
refactor RC_LOGTSTAMP into separate function call
refactor RC_SHELLTITLE into separate function call
refactor RC_TERMCAP, RC_TERMCAPINFO & RC_TERMINFO into separate function call
refactor RC_SLEEP into separate function call
refactor RC_TERM into separate function call
refactor RC_ECHO into separate function call
refactor RC_BELL into separate function call
refactor RC_BUFFERFILE into separate function call
refactor RC_ACTIVITY into separate function call
refactor RC_POW_DETACH_MSG into separate function call
refactor RC_DEFLOGIN & RC_LOGIN into separate function calls
refactor RC_DEFFLOW into separate function call
refactor RC_DEFWRAP into separate function call
refactor RC_DEFC1 into separate function call
refactor RC_DEFBCE into separate function call
refactor RC_DEFGR into separate function call
refactor RC_DEFMONITOR into separate function call
refactor RC_DEFMOUSETRACK & RC_MOUSETRACK into separate function calls
refactor RC_DEFSILENCE into separate function call
refactor RC_VERBOSE into separate function call
refactor RC_HARDSTATUS into separate function call
refactor RC_STATUS into separate function call
refactor RC_CAPTION into separate function call
refactor RC_CONSOLE into separate function call
refactor RC_ALLPARTIAL & RC_PARTIAL into separate function call
refactor RC_VBELL into separate function call
refactor RC_VBELLWAIT, RC_MSGWAIT, RC_MSGMINWAIT & RC_SILENCEWAIT into separate function calls
refactor RC_BUMPRIGHT & RC_BUMPLEFT into separate function calls
refactor RC_COLLAPSE into separate function call
refactor RC_NUMBER into separate function call
refactor RC_ZOMBIE_TIMEOUT into separate function call
refactor RC_SORT into separate function call
refactor RC_SILENCE into separate function call
  also fixes one bug from adding bool b
refactor RC_DEFSCROLLBACK & RC_SCROLLBACK into separate function calls
refactor RC_SESSIONNAME into separate function call
refactor RC_SETENV & RC_UNSETENV into separate function calls
refactor RC_DEFSLOWPASTE & RC_SLOWPASTE into separate function calls
refactor RC_MARKKEYS into separate function call
refactor RC_PASTEFONT into separate function call
refactor RC_CRLF into separate function call
refactor RC_COMPACTHIST into separate function call
refactor RC_HARDCOPY_APPEND into separate function call
refactor RC_VBELL_MSG into separate function call
refactor RC_DEFMODE into separate function call
refactor RC_AUTODETACH into separate function call
refactor RC_STARTUP_MESSAGE into separate function call
refactor RC_BIND into separate function call
refactor RC_BINDKEY into separate function call
refactor RC_MAPTIMEOUT into separate function call
refactor RC_MAPNOTNEXT into separate function call
refactor RC_MAPDEFAULT into separate function call
refactor RC_ACLCHG, RC_ACLADD, RC_ADDACL & CHACL into separate function call
refactor RC_ACLDEL into separate function call
refactor RC_ACLGRP into separate function call
refactor RC_ACLUMASK & RC_UMASK into separate function call
refactor RC_MULTIUSER into separate function call
refactor RC_EXEC into separate function call
refactor RC_DENONBLOCK & RC_NONBLOCK into separate function call
refactor RC_GR into separate function call
refactor RC_C1 into separate function call
refactor RC_DEFENCONDING & RC_ENCODING into separate function calls
refactor RC_DEFUTF8 & RC_UTF8 into separate function calls
refactor RC_PRINTCMD into separate function call
refactor RC_DIGRAPH into separate function call
refactor RC_DEFHSTATUS & RC_HSTATUS into separate function calls
refactor RC_DEFCHARSET & RC_CHARSET into separate function calls
refactor RC_RENDITION & RC_SORENDITION into separate function calls
refactor RC_SOURCE into separate function call
refactor RC_SU into separate function call
refactor RC_SPLIT into separate function call
refactor RC_REMOVE into separate function call
refactor RC_ONLY into separate function call
refactor RC_FIT into separate function call
refactor RC_FOCUS into separate function call
refactor RC_RESIZE into separate function call
refactor RC_SETSID into separate function call
refactor RC_EVAL into separate function call
refactor RC_ALTSCREEN into separate function call
refactor RC_BACKTICK into separate function call
refactor RC_BLANKER & RC_BLANKERPRG into separate function calls
refactor RC_IDLE into separate function call
refactor RC_FOCUSMINSIZE into separate function call
refactor RC_GROUP into separate function call
refactor RC_LAYOUT into separate function call
refactor RC_CJKWIDTH into separate function call
refactor RC_TRUECOLOR into separate function call
2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
9d711b1433 reduce bool b scope 2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
aaa08ac9af reduce i scope 2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
da6e343a98 Window *p does not need whole function scope 2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
aada2d78ac use ARRAY_SIZE for SocketPath size
while at it make its size more reasonable
2018-04-06 00:18:32 +02:00
Amadeusz Sławiński
22e02cc018 reformat macro, so it's readable 2018-04-04 22:58:44 +02:00
Amadeusz Sławiński
0b74182d28 add row/column report escape sequence
suggested by Micah Cowan

Bug: 23719
2018-03-03 23:33:58 +01:00
Amadeusz Sławiński
e43d6459e1 sort switch cases in raising order 2018-03-03 23:33:58 +01:00
Amadeusz Sławiński
a4363ce197 remove unneeded broken parsing
correct utf8 length is maximally 4 bytes only
2018-03-03 23:33:58 +01:00
Amadeusz Sławiński
b282683867 cast pointer to correct type 2018-03-03 23:33:39 +01:00
Amadeusz Sławiński
cd3ced3068 operate on correct types 2018-03-03 18:52:49 +01:00
Amadeusz Sławiński
0c526b72df tables want int
warning: array subscript has type ‘char’ [-Wchar-subscripts]
2018-03-03 18:52:49 +01:00
Amadeusz Sławiński
2b54f835be get rid of signedness warnings 2018-03-03 18:52:49 +01:00
Amadeusz Sławiński
b7dd6ff4ca redefine functions as operating on 32 bits characters 2018-03-03 18:52:49 +01:00
Amadeusz Sławiński
f18f5d0da1 get rid of fontx
in UTF8 encodings it was used to store part of character
(c << 16), but now that character is ensured to be 32 bits, it's not needed
2018-03-03 18:52:49 +01:00
Amadeusz Sławiński
af05a4a6e5 make sure ParseSwitch operates on initialized values 2018-03-03 17:06:03 +01:00
Amadeusz Sławiński
e917d52cb6 get rid of warnings about lflag being unused 2018-03-03 16:00:03 +01:00
Amadeusz Sławiński
9e484fe80e fix clang warnings
clang says:
Argument with 'nonnull' attribute passed null
2018-03-03 15:56:56 +01:00
Amadeusz Sławiński
e3ebe5a7e6 memcpy -> memmove 2018-02-11 13:59:06 +01:00
Amadeusz Sławiński
dc5661bde1 mark Finit as noreturn
fixes -Wimplicit-fallthrough warning
2018-02-07 00:16:56 +01:00
Amadeusz Sławiński
30395482ff quiet -Wimplicit-fallthrough warning 2018-02-07 00:16:56 +01:00
Ryan
fa3f485d6e support sgr mouse mose
cherry-picked from v4 version

biggest difference is formatting
some type changes due to use of typedefs (ie struct canvas -> Canvas)

Bug: #37206
2018-02-07 00:16:56 +01:00
Amadeusz Sławiński
ff093dc8f3 replace $SYSSCREENRC with $SYSTEM_SCREENRC in docs 2018-02-07 00:16:56 +01:00
Alexander Naumov
e790b6f4d5 update copyright for 2018 2018-01-11 16:41:39 +01:00
Alexander Naumov
9c8923299d 'lflag' is used when screen is build with utmp support
This commit reverts commit 9c7c38b2fe

Thanks to Amadeusz for pointing
2017-12-23 01:08:55 +01:00
Alexander Naumov
5783623bc3 adding NULL pointer check 2017-12-19 17:56:22 +01:00
Alexander Naumov
9c7c38b2fe Value stored to 'lflag' is never read 2017-12-19 09:26:07 +01:00
Amadeusz Sławiński
adae52b23a Revert "fix restoring cursor position after leaving altscreen"
This caused degrade when restoring cursor in other cases,
revert, while looking for better fix

This reverts commit a48e1f96dc.

Bug: 51832
2017-10-03 11:13:52 +02:00
Nate Clark
250a064cb3 termcap.c: in FreeTransTable set D_xtable to NULL
After freeing D_xtable set the value to NULL so that checks of D_xtable
return false. RAW_PUTCHAR can cause a segfault if invoked after
FreeTransTable. This can happen in FreeDisplay when SetTTY encounters an
error performing an ioctl on the tty.

0  0x000055583e7032a4 in RAW_PUTCHAR (c=110) at display.c:656
1  0x000055583e6cbe4c in PutWinMsg (s=0x55583e932801 <winmsg_buf+1> "clark-dt -*  ",
   s@entry=0x55583e932800 <winmsg_buf> "nclark-dt -*  ", start=<optimized out>, start@entry=0, max=40, max@entry=49) at screen.c:3053
2  0x000055583e7003f6 in PrePutWinMsg (s=0x55583e932800 <winmsg_buf> "nclark-dt -*  ", start=0, max=49) at display.c:2174
3  0x000055583e705339 in RefreshLine (y=65, from=<optimized out>, to=48, isblank=0) at display.c:2399
4  0x000055583e70630c in MakeStatus (msg=0x7ffeaa03d7d0 "SetTTY (fd 3): ioctl failed: Input/output error") at display.c:2056
5  0x000055583e6c8a68 in Msg (err=<optimized out>, fmt=<optimized out>) at screen.c:2091
6  0x000055583e6c83a1 in CoreDump (sigsig=<optimized out>) at screen.c:1664
7  <signal handler called>
8  0x000055583e7032a4 in RAW_PUTCHAR (c=110) at display.c:656
9  0x000055583e6cbe4c in PutWinMsg (s=0x55583e932801 <winmsg_buf+1> "clark-dt -*  ",
   s@entry=0x55583e932800 <winmsg_buf> "nclark-dt -*  ", start=<optimized out>, start@entry=0, max=40) at screen.c:3053
10 0x000055583e700443 in PrePutWinMsg (s=0x55583e932800 <winmsg_buf> "nclark-dt -*  ", start=0, max=<optimized out>) at display.c:2165
11 0x000055583e705339 in RefreshLine (y=65, from=<optimized out>, to=48, isblank=0) at display.c:2399
12 0x000055583e70630c in MakeStatus (msg=0x7ffeaa040780 "SetTTY (fd 3): ioctl failed: Input/output error") at display.c:2056
13 0x000055583e6c8a68 in Msg (err=<optimized out>, fmt=<optimized out>, fmt@entry=0x55583e719f41 "SetTTY (fd %d): ioctl failed") at screen.c:2091
14 0x000055583e6dfadc in SetTTY (fd=<optimized out>, mp=<optimized out>) at tty.c:624
15 0x000055583e707d08 in FreeDisplay () at display.c:340
16 0x000055583e6c8612 in Detach (mode=mode@entry=2) at screen.c:2000
17 0x000055583e6dbb52 in FinishDetach (m=0x55583e933b80 <m>) at socket.c:1607
18 0x000055583e6ddcd5 in FinishAttach (m=m@entry=0x55583e933b80 <m>) at socket.c:1424
19 0x000055583e6de531 in ReceiveMsg () at socket.c:1235
20 0x000055583e711583 in sched () at sched.c:237
21 0x000055583e6c7113 in main (ac=0, av=<optimized out>) at screen.c:1466

Bug: 52133

Signed-off-by: Nate Clark <nate@neworld.us>
2017-09-28 10:55:08 +02:00
Amadeusz Sławiński
d924195730 use memmove instead of memcpy 2017-09-27 09:47:59 +02:00
Amadeusz Sławiński
ed566a0f43 fix some ./configure --help messages 2017-09-27 09:47:59 +02:00
Amadeusz Sławiński
9119fc4311 clear buffer with zeros 2017-09-27 09:47:59 +02:00
Amadeusz Sławiński
184cf03663 remove defines which are part of posix 2017-09-27 09:47:59 +02:00
Amadeusz Sławiński
14b54b47bd reduce variables scope 2017-09-27 09:47:59 +02:00
Amadeusz Sławiński
ec86466cdd utf8 is enabled by default 2017-09-27 09:47:59 +02:00
Amadeusz Sławiński
08a454c7a0 reduce variables scope 2017-09-27 09:47:59 +02:00
Curtis Brown
c0f9954916 documentation fix for command "resize"
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
2017-09-26 16:58:33 +02:00
Amadeusz Sławiński
427328c666 reduce variable scope 2017-09-14 14:04:43 +02:00
Amadeusz Sławiński
4b8463129c change outbut buffer len to size_t 2017-09-04 13:24:33 +02:00
Lubomir Rintel
11a74b8382 ansi: terminate xterm OSC response the same way as the request
There's two way to terinate an OSC: ST (\033\\) or BEL (\a). Use
whatever the original request used instead of always forcing a BEL.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2017-09-01 10:48:53 +02:00
Lubomir Rintel
7059bff20a ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.

Tested with gnome-terminal and xterm. When called with "?" argument the
current background color is returned:

  $ echo -ne "\e]11;?\e\\"
  $ 11;rgb:2323/2727/2929

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2017-09-01 10:48:48 +02:00
Tore Sinding Bekkedal
747c39d518 Fix unlock prompt when GECOS is CSVs 2017-08-31 14:32:04 +02:00
Lubomir Rintel
d79eace3da doc: remove references to -DDEBUG
It has been gone since 272b68b2e [bye bye DEBUG].

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2017-08-31 12:14:36 +02:00
Jon Jensen
6baca9df1c Remove documentation for defzombie setting which doesn't exist 2017-08-17 10:21:31 +02:00
Amadeusz Sławiński
56f027eeb4 move exit_with_usage to only file that uses it
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-08-02 12:55:24 +02:00
Amadeusz Sławiński
20f17deb38 add check for window size when resizing "lists"
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-31 13:43:04 +02:00
Amadeusz Sławiński
6dafd8b777 only show license on terminal with width above 40
It's almost unreadable on anything less
also we need to find space in the specified witdh, to make line breaks,
longest piece of text uninterrupted by space is 29 characters (link to
GPL license)

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-31 13:43:04 +02:00