Commit Graph

1189 Commits

Author SHA1 Message Date
Marcin Cieślak
0285fd2d0e manpage: explain flow control state indicators with a table 2018-05-31 14:36:05 +02:00
Marcin Cieślak
6fe22d6506 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:36:05 +02:00
Marcin Cieślak
7ef6811606 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:36:05 +02:00
Marcin Cieślak
456581932e 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:36:05 +02:00
Amadeusz Sławiński
e2a3b9ba24 check if we succeeded in SttyMode
should detect invalid parameters, like bad baud modes

Bug: 50849
2018-05-31 14:34:29 +02:00
Amadeusz Sławiński
dbe1eb72b2 make sure we get all Panic messages
move reassociating streams to after we get display, otherwise there
is short window where we printf to /dev/null if we fail
2018-05-31 14:34:24 +02:00
Amadeusz Sławiński
55b7006260 clean up hostname mangling in utmp
we shouldn't mangle hostname name as it may break if host is ipv6 address

Bug: 48661
2018-05-22 21:30:59 +02:00
Amadeusz Sławiński
f2f5fd49d3 macro formatting 2018-05-22 21:30:59 +02:00
Amadeusz Sławiński
8613a96fa7 fix gcc warning
screen.c: In function ‘main’:
screen.c:940:4: warning: ‘strncpy’ output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
    strncpy(ap, "SCREEN", 6); /* name this process "SCREEN-BACKEND" */
    ^~~~~~~~~~~~~~~~~~~~~~~~
2018-05-22 21:30:59 +02:00
Amadeusz Sławiński
c82d70de9c this actually should be 3 dots
they are part of syntax
2018-05-15 21:20:27 +02:00
Amadeusz Sławiński
d6c05f5e41 fix job control on FreeBSD
this is readded based on code which already was there
in older versions

we need TIOCSCTTY ioctl to set session control terminal

I'm not adding any system ifdefs, as it doesn't seem
like it should break anything on linux

Bug: 49170
2018-05-15 20:02:37 +02:00
Amadeusz Sławiński
7700a38f68 release TIOCEXCL on ptys when closed
Bug: 52248
2018-05-15 20:01:52 +02:00
Amadeusz Sławiński
28dbee5063 remove exclusive access when closing ptyfd 2018-05-15 20:01:52 +02:00
Amadeusz Sławiński
fc40d1b9c7 fix buffer size
In file included from /usr/include/string.h:494,
                 from os.h:41,
                 from screen.h:37,
                 from winmsgbuf.h:28,
                 from process.h:4,
                 from process.c:36:
In function ‘strncpy’,
    inlined from ‘ShowDInfo’ at process.c:6241:3:
/usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ offset [386, 513] is out of the bounds [0, 128] of object ‘buf’ with type ‘char[128]’ [-Warray-bounds]
   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
process.c: In function ‘ShowDInfo’:
process.c:6231:7: note: ‘buf’ declared here
  char buf[128], *p;
       ^~~

later in code we set l = 512, but buffer is only 128, increase buffer
size to 512
2018-05-13 11:08:11 +02:00
Amadeusz Sławiński
85d5570cf6 fix buffer size
help.c: In function ‘helppage’:
help.c:222:52: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 220 and 228 [-Wformat-overflow=]
     sprintf(cbuf, "Command key:  %s   Literal %s:  %s", Esc_buf, Esc_buf, buf);
                                                    ^~                     ~~~
In file included from /usr/include/stdio.h:862,
                 from os.h:32,
                 from acls.h:32,
                 from comm.h:8,
                 from help.h:4,
                 from help.c:34:
/usr/include/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 29 and 292 bytes into a destination of size 256
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cbuf has size of 256, while Esc_buf has size of 5 and buf of 256
so printing literal string + those others may end up with longer string
in cbuf
fix that by increasing cbuf size
2018-05-13 11:04:04 +02:00
Marcin Cieślak
cb59b9dac1 Fix [bug #53552] wording in the manpage 2018-05-06 12:27:21 +00:00
Marcin Cieślak
59a33d6ba2 groff warning: can't find font "p" 2018-05-06 12:18:29 +00:00
Marcin Cieślak
22190a161a 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-06 12:17:41 +00:00
Marcin Cieślak
c35fe712d4 Provide fallback for Unicode ellipsis 2018-05-06 12:11:03 +00:00
Marcin Cieślak
f0ab72acf0 Fix intendation around "displays"
Remove UTF-8 quotes
2018-05-06 11:57:57 +00:00
Amadeusz Sławiński
ae04c6ace9 fix sort command
I don't even want to look at mails & git log why it was so broken
even before refactoring (probably my fault ... - need to get to
implementing  automated teast at some time)
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
434b27c128 clean up after refactoring
finally we can get rid of wtab and maxwin
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
9647cd5a7d simplify collapse command 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
f12ada8192 refactor SwapWindows
while at it add two helper functions to add and remove windows from list
and reuse it in MakeWindow for creating windows
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
d995ba7392 refactor AddWindows, so it doesn't use wtab & maxwin 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
d48fef6544 use list for getting windows in order instead of magic on wtab
also remove comment mentioning using wtab for verification, it will
be impossible when wtab is removed
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
e269348e0a refactor NextWindow and PreviousWindow to return Window pointer instead of window number 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
eaf476f54d refactor SwitchWindow to accept Window * as parameter
it makes more sense this way and will make even more when NextWindow and PreviousWindow
return pointer
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
57ff988d7e use last_window->w_number where we need upper bound instead of maxwin
in places where we call GetWindowByNumber, just pass the number if positive, as
it is checked inside function anyway
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
a462bc2858 use GetWindowByNumber(n) instead of wtab[n] 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
033ef5e42a refactor ShowWindowsX to use window list, now that we can 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
854a6db170 add function to search for window by number 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
7ecf4f1d3e use linked window list now that we can 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
da4a425fcc create bidirectional list of windows 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
8be327be94 rename windows to mru_window and window->w_next to window->w_prev_mru
those variables are used to maintain most recently used list and I want
to reuse w_next to make proper list of windows instead of wtab

when we loop it doesn't make difference in which order we go, so we may
as well keep looping using mru list (and review later when we introduce
in order list)
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
f11283ffc9 get rid of unneeded variable 2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
6470f7e5be always create C-a [0-9] shortcuts
we now dynamically allocate number of windows, and by default it starts with 16
2018-04-11 21:42:16 +02:00
Amadeusz Sławiński
362aec1da8 use function to get number of perpendicular canvases 2018-04-07 13:29:11 +02:00
Amadeusz Sławiński
452c62988d reduce variables scope 2018-04-07 13:29:11 +02:00
Amadeusz Sławiński
30f1d39ca5 refactor RefreshXtermOSC() 2018-04-07 13:29:11 +02:00
Amadeusz Sławiński
60e19ab26e get rid of (sometype *)0 casts
using NULL makes it clear enough what's going on
2018-04-07 13:29:11 +02:00
Amadeusz Sławiński
12aed9c422 make docs build 2018-04-06 00:30:21 +02:00
Amadeusz Sławiński
2fe567f24d silence clang warnings
warning: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Wconstant-conversion]
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
e52b2b45c5 reduce variable scope from global to function 2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
89c4a48756 redefine screen_conv as static function
fixes sparse warning:
socket.c:1124:5: warning: symbol 'screen_conv' was not declared. Should it be static?
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
c368611c9a fix SetTtyname definition
SetTtyname was forward declared as static, so define it that way
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
81a2699fdd use NULL instead of 0 where applicable
found with sparse
warning: Using plain integer as NULL pointer
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
9b5a5ed228 fix non-ANSI function declarations
as per sparse warnings:
warning: non-ANSI function declaration of function '...'
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
af7e07f970 add comm.h as dependency
fixes failures when doing multijob build
2018-04-06 00:18:33 +02:00
Amadeusz Sławiński
f07f01985d remove now unused key parameter from DoAction 2018-04-06 00:18:33 +02:00