Commit Graph

604 Commits

Author SHA1 Message Date
Lubomir Rintel
c5db181b6e 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>
(cherry picked from commit 7059bff20a)
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:25 +01:00
Therese Godefroy
ee12d36719 apply patch by Therese fixing some doc issues
This fixes some issues when documentation is generated for online
viewing.
2018-10-12 00:48:30 +02:00
Svyatoslav Mishyn
f96263221b doc: fix typos
Hi there,

just found a few typos, see attachment.

(please, CC me)

Thanks.

--
https://www.juef.space/

From 745ba353867142d3e00f4d2ab06962ba0d3aaaab Mon Sep 17 00:00:00 2001
From: Svyatoslav Mishyn <svyatoslav.mishyn@gmail.com>
Date: Wed, 4 Jul 2018 21:40:48 +0300
Subject: [PATCH] doc: fix typos
2018-07-24 23:19:31 +02:00
Amadeusz Sławiński
26b4c2d790 remove character substitution
it may be not compatible with some man page viewers
2018-06-21 21:47:03 +02:00
Eric S. Raymond
123f7cbbf4 fix man page 2018-06-21 21:41:12 +02:00
Marcin Cieślak
6c880e68a3 manpage: Explain window permissions in a table 2018-05-31 14:38:42 +02:00
Marcin Cieślak
0d9858e71d manpage: Use monospaced font to render example of "displays" 2018-05-31 14:38:34 +02:00
Marcin Cieślak
f891379e02 manpage: Indent both examples for readreg 2018-05-31 14:38:28 +02:00
Marcin Cieślak
a2669fdfa5 manpage: keep nonblock and status parameters on the same line 2018-05-31 14:38:21 +02:00
Marcin Cieślak
e3a4818f6e manpage: explain flow control state indicators with a table 2018-05-31 14:38:15 +02:00
Marcin Cieślak
94b07411c9 manpage: Remove horizontal lines on large tables
Remove "allbox" tbl option from large keybinding table.
When formatting for print, large tbl tables need to be handled
specially to split nicely across the pages; instead we
just add horizontal lines and we let them overflow the pages.

The input translation table seems to fit nicely on one page
and is left as is with the "allbox" option.
2018-05-31 14:38:07 +02:00
Marcin Cieślak
f1935c872e manpage: add vertical space after bindkey examples
bindkey examples seem to be glued to their following descriptions.
This looks bad in the printable versions, so give it some space.

Alternatively we could possibly reverse the indentation and use
something like this:

bindkey -d

      Show all of the default key bindings.

but this is inconsistent with other examples.
2018-05-31 14:38:01 +02:00
Marcin Cieślak
e6d02361b1 manpage: Print = instead of double horizontal line
"Keypad =" table entry had a double horizontal line instead of a single "="
when printed with troff.

From "Tbl -- A Program to Format Tables" by M. E. Lesk:

Single column horizontal lines
    -- An input table entry containing only the character (...) = is
    taken to be a single or double line extending the full width of the
    column. Such lines are extended to meet horizontal or vertical
    lines adjoining this column. To obtain these characters explicitly
    in a column, either precede them by \& or follow them by a space
    before the usual tab or newline.
2018-05-31 14:37:53 +02:00
Amadeusz Sławiński
3f8777e6cf this actually should be 3 dots
they are part of syntax
2018-05-15 21:21:17 +02:00
Marcin Cieślak
9be818e155 Fix [bug #53552] wording in the manpage 2018-05-07 22:46:30 +02:00
Marcin Cieślak
75667719b7 groff warning: can't find font "p" 2018-05-07 22:46:24 +02:00
Marcin Cieślak
0fb08f4477 Fix (login) entry in the default bindings
nroff warning:

tbl:src/doc/screen.1:551: excess data entry `(lastmsg)' discarded
tbl:src/doc/screen.1:553: excess data entry `Repeat the last message displayed in the message line.
' discarded
2018-05-07 22:46:17 +02:00
Marcin Cieślak
97f004299a Provide fallback for Unicode ellipsis 2018-05-07 22:46:10 +02:00
Marcin Cieślak
35c9247dc2 Fix intendation around "displays"
Remove UTF-8 quotes
2018-05-07 22:45:58 +02:00
Amadeusz Sławiński
c91ab990a0 screen v4 has no truecolor support, so remove it from manpage 2018-04-04 23:00:47 +02:00
Alexander Naumov
bcd7cab017 Update Changelog (applying patches - bug#43223)
Cross-compilation support

Thanks for patches to Maarten ter Huurne <maarten@treewalker.org>
and Jussi Kukkonen <jussi.kukkonen@intel.com>

Thanks for testing these (4.6.2) on ARM (Xilinx Zynq) to
Ben Kamen <ben@benkamen.net>
2018-02-24 15:47:20 +01:00
Jussi Kukkonen
ec90292592 [PATCH 4/4] Avoid mis-identifying systems as SVR4
Linux can be misdetected as SVR4 because it has
libelf installed. This leads to linking with libelf, even though no
symbols from that library were actually used, and to a workaround for
a buggy getlogin() being enabled.

It is not documented which exact SVR4 system had the bug that the
workaround was added for, so all I could do is make an educated guess
at the #defines its compiler would be likely to set.

Modified from patch by Maarten ter Huurne.

Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2018-02-24 15:22:05 +01:00
Jussi Kukkonen
c573b89139 [PATCH 3/4] Skip host file system checks when cross-compiling
Modified from patch by Maarten ter Huurne.

Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2018-02-24 15:18:33 +01:00
Jussi Kukkonen
abba47ce42 [PATCH 2/4] Provide cross compile alternatives for AC_TRY_RUN
Modified from patch by Maarten ter Huurne.

Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2018-02-24 15:14:48 +01:00
Jussi Kukkonen
6b320186db [PATCH 1/4] Remove redundant compiler sanity checks
AC_PROG_CC already performs sanity checks. And unlike the removed
checks, it does so in a way that supports cross compilation.

Modified from patch by Maarten ter Huurne.

Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2018-02-24 15:09:10 +01:00
Ryan
40819ffe2b support sgr mouse mose
Bug: #37206
2018-02-07 00:17:07 +01:00
Alexander Naumov
3e9aeb3316 update copyright for 2018 2018-01-11 16:53:20 +01:00
Amadeusz Sławiński
5c3643fb70 fix: configure option "--disable-use-locale" is not working
Bug: 52663
2017-12-16 15:09:57 +01:00
Hongxu Jia
8c2b4061d1 fix configure failed while build dir name contains "yes"
While build dir name contained "yes", and compiled with
producing debugging information (-g), the configure failed.

The pattern of AC_EGREP_CPP (string "yes") mismatched with
dir name. It caused the test of AC_EGREP_CPP incorrect.

Use YES_IS_DEFINED to replace yes which is not often used
as dir name.

Bug: 52329
(Fix release v.4.6.2 or above)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2017-11-08 18:33:41 +01:00
Amadeusz Sławiński
aa6165ef67 Release v.4.6.2
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
v.4.6.2
2017-10-23 14:18:26 +02:00
Alexander Naumov
46bc00dd34 Replace the use of read /dev/kmem by a syscall for AIX platforms
bug #49148
2017-10-04 15:21:36 +02:00
Amadeusz Sławiński
aaac75d809 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 8062db33b8.

Bug: 51832
2017-10-03 11:11:44 +02:00
Nate Clark
9019b0d063 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:54:37 +02:00
Curtis Brown
81d89922ad documentation fix for command "resize" 2017-09-26 16:48:50 +02:00
Jon Jensen
68b87ac1ce Remove documentation for defzombie setting which doesn't exist 2017-08-17 10:12:38 +02:00
Amadeusz Sławiński
65aea38433 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-08-02 14:21:58 +02:00
Amadeusz Sławiński
f64cff77bd check if display exists before dereferencing it
Bug: 43054
Bug: 51500

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2017-08-02 14:18:34 +02:00
Amadeusz Sławiński
9c9bdcbcd9 Release v.4.6.1 v.4.6.1 2017-07-10 21:25:10 +02:00
Amadeusz Sławiński
ca4f7503e5 fix segfault when querying info on nonUTF screen
Bug: 51402
2017-07-10 21:06:11 +02:00
Matt Whitlock
7dad1f268f Fix parallel make install
Fixes:
https://bugs.gentoo.org/show_bug.cgi?id=611130
2017-07-01 21:44:00 +02:00
Clark Wang
0f5e9affa4 restore missing code which was wrongly removed
fixes regression introduced by migrating from pipe to sockets
http://lists.gnu.org/archive/html/screen-users/2017-06/msg00001.html
2017-07-01 21:32:43 +02:00
Amadeusz Sławiński
f8fb068b51 Release v4.6.0 v.4.6.0 2017-06-28 20:08:56 +02:00
Guo Ci
afa26c59ca begin viewing scrollback buffer at the first line of output instead of at the start of the scrollback buffer
This issue has been discussed before:
https://bbs.archlinux.org/viewtopic.php?id=108640

Copy mode and “hardcopy -h” always begin at the start of the scrollback buffer.
If a user sets a large scrollback limit with little output, then copy mode and
the file written by “hardcopy -h” will begin with many blank lines before the
first line of output.

The attached patch limits the scrollback buffer traversal to begin at the first
line of output, instead of the beginning of the scrollback buffer.

Also, code for moving to %age of buffer is changed to use float division so
that two different rep_cnt will not jump to the same location, except for
buffers less than 100 lines. Previously, the computed line number is rounded
down to the nearest 100th due to integer division.

Bug: 49377
2017-06-22 11:01:14 +02:00
Brian De Wolf
c10e997899 update unicode wide tables
Bug: 50044
2017-06-21 22:54:01 +02:00
Amadeusz Sławiński
49dd273566 Add more serial speeds
make idx unique
reorder from highest speed to lowest
2017-06-09 11:03:56 +02:00
Christian Brauner
79f755ff5c screen: don't stat("")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-30 22:12:25 +02:00
Amadeusz Sławiński
50b576fbeb fix typos 2017-04-18 13:19:46 +02:00
Christian Brauner
bab73f99a2 add compat layer to handle both fifos and sockets
So far screen could only support either sockets or fifos but not both. This
proved to be a blocker for any upgrade. This adds a compatibility layer to
screen v4 to support both sockets and fifos at the same time. The strategy here
is to only support fifos for legacy sessions that already exist. All new
sessions will use sockets by default.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-04-18 10:53:29 +02:00
Amadeusz Sławiński
8062db33b8 fix restoring cursor position after leaving altscreen
When swapping to altscreen, also swap cursor position

Bug: 49883
2017-04-06 11:34:04 +02:00
Christian Brauner
7e755ed62d screen: handle pts devices in different namespaces
Various programs that deal with namespaces will use pty devices that exist in
another namespace. One obvious candidate are containers. So far ttyname() was
incorrectly handling this case because the pts device stems from the host and
thus cannot be found amongst the current namespace's /dev/pts/<n> entries.
Serge Hallyn and I recently upstreamed patches to glibc that allow ttyname{_r}()
to correctly handle this case. At a minimum, ttyname{_r}() will set errno to
ENODEV in case it finds that the /dev/pts/<n> device that the symlink points to
exists in another namespace.

(The next comment is a little longer but tries to ensure that one can still
understand what is going on after some time has passed.)
In case we detect that ttyname{_r}() returns NULL and sets errno to ENODEV we
have ample reason to assume that the pts device exists in a different
namespace. In this case, the code will set a global flag indicating this case
to true. Furthermore, all operations (e.g. chmod(), chown(), etc.) will now
need to operate on the symbolic link /proc/self/fd/0 directly. While this
sounds straightforward, it becomes difficult to handle this case correctly when
we reattach to an already existing screen session from a different pts device
than the original one. Let's look at the general reattach logic a little
closer:

Assume we are running a shell that uses a pts device from a different
namespace:

	root@zest1:~# ls -al /proc/self/fd/
	total 0
	dr-x------ 2 root root  0 Apr  2 20:22 .
	dr-xr-xr-x 9 root root  0 Apr  2 20:22 ..
	lrwx------ 1 root root 64 Apr  2 20:22 0 -> /dev/pts/6
	lrwx------ 1 root root 64 Apr  2 20:22 1 -> /dev/pts/6
	lrwx------ 1 root root 64 Apr  2 20:22 2 -> /dev/pts/6
	l-wx------ 1 root root 64 Apr  2 20:22 3 -> pipe:[3067913]
	lr-x------ 1 root root 64 Apr  2 20:22 4 -> /proc/27413/fd
	lrwx------ 1 root root 64 Apr  2 20:22 9 -> socket:[32944]

	root@zest1:~# ls -al /dev/pts/
	total 0
	drwxr-xr-x 2 root root      0 Mar 30 17:55 .
	drwxr-xr-x 8 root root    580 Mar 30 17:55 ..
	crw--w---- 1 root tty  136, 0 Mar 30 17:55 0
	crw--w---- 1 root tty  136, 1 Mar 30 17:55 1
	crw--w---- 1 root tty  136, 2 Mar 30 17:55 2
	crw--w---- 1 root tty  136, 3 Mar 30 17:55 3
	crw--w---- 1 root tty  136, 4 Mar 30 17:55 4
	crw-rw-rw- 1 root root   5, 2 Apr  2 20:22 ptmx

(As one can see /dev/pts/6 does not exist in the current namespace.)
Now, start a screen session in this shell. In this case this patch will have
screen directly operate on /proc/self/fd/0.
Let's look at the attach case. When we attach to an existing screen session
where the associated pts device lives in another namespace we need a way to
uniquely identify the pts device that is used and also need a way to get a
valid fd when we need one. This patch solves this by ensuring that a valid file
descriptor to the pts device is sent via a unix socket and SCM_RIGHTS to the
socket and display handling part of screen. However, screen also sends around
the name of the associated pts device or, in the case where the pts device
exists in another namespace, the symlink /proc/self/fd/0. But after having sent
the fd this part of the codebase cannot simply operate on /proc/self/fd/0 since
it very likely refers to a different file. So we need to operate on
/proc/self/fd/<fd-sent-via-SCM_RIGHTS> but also need to ensure that we haven't
been tricked into operating on a tampered with file or device. So we cannot
simply sent /proc/self/fd/0 via the unix socket. Instead we read the contents
of the symbolic link /proc/self/fd/0 in the main function and sent it via the
unix socket. Then in the socket and display handling part of screen, we read
the contents of the /proc/self/fd/<fd-sent-via-SCM_RIGHTS> as well and compare
the pts device names. If they match we know that everything is well. However,
now we also need to update any tty handling code to directly operate on
/proc/self/fd/<fd-sent-via-SCM_RIGHTS>.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-04-06 10:14:20 +02:00