If we can't reliably identify slow terminal, we should not implicitly disable
verbose mode, instead let user disable it manually by starting with the slow
terminal switch.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
> If you are not using some other optimization option, consider using -Og (see
> Options That Control Optimization) with -g. With no -O option at all, some
> compiler passes that collect information useful for debugging do not run at
> all, so that -Og may result in a better debugging experience.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
`AM_PROG_CC_C_O` is part of `AC_PROG_CC` since Automake 1.14, released in 2013
and we are almost in 2025 by now.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Starting with bash 5.1, PROMPT_COMMAND can be an array. Detect this
case and append an entry to the array instead of appending to a string.
Testing for bash >= 5 is sufficient, because the @a operator exists in
5.0. We need eval on the "then" branch because bash 1.x cannot even
parse that line (it does not support arrays).
Bug: https://bugs.gentoo.org/930401
Suggested-by: kfm@plushkava.net
Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Add a new variable to let fish know that -- since the parent commit
-- we are running a version where fish can use the kitty keyboard
protocol without breaking mc.
In a few years, both fish and mc should ideally remove this hack
(and fish should speak the kitty keyboard protocol unconditionally),
so no one should rely on this new variable except as a temporary
workaround. Hence the feature-specific flag and not a generic version
variable.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
If a subshell (like fish 4.0) wishes to use "Disambiguate control keys"
from https://sw.kovidgoyal.net/kitty/keyboard-protocol/, ctrl-o sends
a multi-byte sequence. Let's make sure we can intercept that too so
we can suspend the shell.
Note that the shell already disables "Disambiguate control keys"
while it's suspended, so no other changes should be necessary.
Unfortunately there is one bug left: when I start "SHELL=$(which
fish) mc" and type `ctrl-o`, fish does not recognize CSI u bindings
(such as `bind ctrl-2 'echo hello'`) yet. It only works after the
second prompt. I haven't had time to figure that out.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Non-XPG4 version of `tail` fails if you call it as `tail -n 1`, but `tail -1`
works everywhere and is portable.
```
% ssh solaris
Last login: Sun Oct 20 12:20:56 2024 from 192.168.64.1
Oracle Solaris 11.4.42.111.0 Assembled December 2021
root@solaris:~# tail -n 1 .profile
usage: tail [+/-[n][lbc][f]] [file]
tail [+/-[n][l][r|f]] [file]
root@solaris:~# tail -1 .profile
root@solaris:~# head -n 1 .profile
root@solaris:~# head -1 .profile
root@solaris:~# /usr/xpg4/bin/tail -n 1 .profile
```
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
* 4600_filter_segfault:
src/filemanager/{achown,chattr,chmod,chown}.c: get rid of code duplication.
(panel_callback) [MSG_FOCUS]: remove self-draw here.
Disable all cursor movements if file panel is empty.
(start_search): don't start quick search if file panel is empty.
Clarify panel->currrent if file panel is empty.
Ticket #4600: fix segfault on panel filter.
* (panel_find_marked_file):
* (panel_get_marked_file): new WPanel APIs.
* Use these APIs in src/filemanager/{achown,chattr,chmod,chown}.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (panel_do_cd_int): set panel->current to -1 file list is empty.
* (panel_set_current_by_name): likewise.
* (panel_sized_with_dir_new): likewise.
* (panel_reload): likewise.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
mc segfaults if filter makes file panel empty.
* (panel_current_entry): improve. Add checks if panel->current is in
range of file list.
* A lot of changes to use modified panel_current_entry().
* (format_file):
* (display_mini_info): fix drawing of mini-status if file panel is
empty.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Non-Linux systems don't always name the user and group with uid/gid of 0
"root". On macOS group "wheel" has gid of 0 and group "root" doesn't exist. On
FreeBSD there is a user with gid of 0 named "toor". This causes user/group id
lookups in mc to fail and instead return the uid/gid of the current user.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>