1324 Commits

Author SHA1 Message Date
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
Amadeusz Sławiński
15b102c15c clean copyright stuff from help.[ch]
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-31 13:43:04 +02:00
Amadeusz Sławiński
56ee40c70e trigger full rebuild of rows on resize
needed because when showing license we need to recalculate line lenghts

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-31 13:43:04 +02:00
Amadeusz Sławiński
892ef64cd9 reuse list code, to show license
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-31 13:43:04 +02:00
Richard Lavigne
c22d4010fb Modify documentation to reflect how to use the new color codes. Documentation still seems incomplete or wrong. 2017-07-31 13:35:44 +02:00
Richard Lavigne
3549f9a4ce Add new color formatting codes. HTML style #ABC or #AABBCC. Starting character can be x or # 2017-07-31 13:35:44 +02:00
Amadeusz Sławiński
f5d11d9d22 reduce user bits granularity
otherwise we end up with w_monitor still enabled after :monitor off

./screen
C-a :defmonitor on
C-a c
sleep 5 && echo -e "\a"
C-a c
C-a :monitor off
sleep 5 && echo -e "\a"
C-a 0
C-a :windowlist

it should render 1 and 2 window differently on windowlist
will need to be checked later, how it works with more than one user

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-31 13:35:44 +02:00
Amadeusz Sławiński
f99b9b8bc0 stop clobbering display variable
not sure why it was done, but it seems to serve no functional purpose at
all and breaks displaying flags in :windowlist
display is used by AddWindowFlags to check whether we should show some
of flags and they are not shown when display == 0

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-24 17:47:17 +02:00
Amadeusz Sławiński
a5d0841f85 check if display exists before dereferencing it
Bug: 43054
Bug: 51500

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-24 17:09:48 +02:00
Amadeusz Sławiński
c8e8793b17 remove leftover debug 2017-07-20 12:35:36 +02:00
Amadeusz Sławiński
2fb4965f09 return number of on screen lines
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-11 16:26:56 +02:00
Amadeusz Sławiński
d5b4bce6b9 fix segfault when querying info on nonUTF screen
Bug: 51402
2017-07-10 21:08:24 +02:00
Amadeusz Sławiński
a9cac76d81 fix typo in comment
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-09 23:51:18 +02:00
Amadeusz Sławiński
2672c2a8f4 remove cruft from pty.c
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-07-09 23:51:16 +02:00