Commit Graph

5938 Commits

Author SHA1 Message Date
Andrew Borodin
0776f2a49c Fix typos.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-13 16:31:22 +03:00
Oswald Buddenhagen
8857423e4e Ticket #4128: improve handling of compressed content in mc.ext.
call 'file' with -z switch to enable getting the type of compressed files,
and use that capability extensively.

the /logs?/ hacks in ext.d/text.sh need to remain for the time being, as
file -z doesn't handle .lz4 files as encapsulated content.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:36:09 +03:00
Oswald Buddenhagen
436296f517 Disable subshell cursor position translation for bash v5+.
the changelog clearly states that the position is now returned as a
character offset.

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
b680f8198d Optimize bash cursor position translation.
the previous algorithm was O(n^2).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
563632819d Make query of subshell command buffer leading-dash-safe.
when the command buffer started with a valid option to the "echo"
command, weird things would happen. use "printf" instead, which doesn't
have this problem. this affected only the bash and zsh code paths.

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
77c910a818 Prevent word-splitting of the subshell command buffer.
this avoids inadvertent whitespace normalization (compression and
trimming), which is annoying and additionally invalidates the cursor
position.

for bash and zsh that meant quoting the variable expansion, while for
fish it meant removing the pointless indirection through echo.
for bash we had to introduce an indirection through a function, as there
is apparently no way to get the quoting right inside the binding. zsh
already had such an indirection - maybe for the same reason?

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
86397c87c6 Fixup FISH subshell setup.
move binding commands out of the fish_prompt function definition, use
consistent command separators, and remove excess backslashes from the
bindings.

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
6b7c4f7c14 Do not avoid big stack allocations.
these are cheap and unproblematic (we aren't in the kernel here).

amends ff0fc17a.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Oswald Buddenhagen
0c1cb8f9a8 Ticket #4126: fixups to persistent subshell command line buffer support.
fix some comments

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-12 08:23:03 +03:00
Andrew Borodin
2f611780d3 Ticket #4124: standalone mcedit crashes at startup.
Subshell: don't setup command line promt if MC is run as standalone
editor/viewer/diffviewer.

Fix ff0fc17ae3.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-09 14:54:37 +03:00
Eric Roberts
631483ec52 Ticket #4120: tcsh error: "The Commander can't change to the directory".
How to reproduce:

Use tsch as your shell.
ctrl-o
ctrl-c
ctrl-o

mc gives the error:
The Commander can't change to the directory that the subshell claims you
are in. Perhaps you have deleted your working directory, or given
yourself extra permissions with the "su" command?

This commit is really simple workaround that makes the problem go away.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-10-04 18:51:31 +03:00
Eric Roberts
ff0fc17ae3 Ticket #4114: implement persistent command line buffer for subshell.
This commi allows the user to start typing a command in the MC's command
line, and then continue typing it in the subshell, or to start typing a
command in the subshell, and then finish typing it in the MC's command
line.

It also fixes #2269 and #2110, bugs in which mc can unexpectedly execute
commands without the user's permission.

The new feature works with bash4, zsh, and fish. The bugfix works on all
shells.

How to test the feature:
  Run mc
  Type any command in the command line, but don't hit enter.
  Press Ctrl-O.
  The command you typed will show up in the subshell.
  Type any command in the subshell, but don't hit enter.
  Press Ctrl-O.
  The command you typed will show up in the command line.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-09-27 19:46:12 +03:00
Andrew Borodin
e1c892a49f Ticket #4107: bind ctrl-i to the ChangePanel action.
After ef5f1fa3eb ctrl-i stopped working
on some terminals including native Linux console.

To fix this, add default binging ctrl-i shortcut to ChangePanel action.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-15 11:45:46 +03:00
Andrew Borodin
dd25f91dfd Refactoring of directory size caclulation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-05 10:43:29 +03:00
Andrew Borodin
5c89d3c2b7 Ticket #4101: wrong copy ETA displaing if "Follow links" is set.
* (do_compute_dir_size): fix directory size calculation.
  Use mc_lstat() if "Follow links" option is set, mc_stat() otherwise.
  * (single_dirsize_cmd): fix compute_dir_size() call.
  * (dirsize_cmd): likewise.
  * (panel_compute_totals): process symlink to directory as directory if
  follow_symlink is set.
  * (panel_operate_init_totals): process symlink to directory as
  directory if "Follow links" option is set.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-05 10:43:29 +03:00
Andrew Borodin
8b4386df83 Ticket #4120: draw shadows for dialog boxes and menus.
Thanks Aleš Janda <ales.janda@kyblsoft.cz> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-08-02 16:13:26 +03:00
Andrew Borodin
8e8b91310a Ticket #4104: chattr: mouse clicks on checkboxes have no effect.
(chattrboxes_mouse_callback): mouse events other than scroll ones are
unhandled.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-07-31 20:52:30 +03:00
Koji Builder
99061cc22d Ticket #4091: RPM VFS improvements.
Support weak dependency tags:

ENHANCES, SUGGESTS, RECOMMENDS, SUPPLEMENTS

See https://rpm.org/user_doc/dependencies.html#weak-dependencies
for detais.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-06-21 20:08:19 +03:00
Andrew Borodin
f5d667197b Ticket #4085: mcedit: regex replace: assertion 'string != NULL' failed.
(edit_replace_cmd): don't delete a NULL string.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:49:05 +03:00
Andrew Borodin
0d585eb08d (file_progress_show_total): use hline_set_textv().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d35f0c68dc Refactoring: use label_set_textv() where reasonable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
562889ce1e Rename macro MC_SKINS_SUBDIR to MC_SKINS_DIR.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
81b1f47e01 Rename macros with editor-related file locations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
3c38214458 (edit_close_cmd): refactor to reduce number of type castings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d786d88299 Find file refactoring:
* (find_cmd): remove.
  * (find_file): rename to find_cmd() and move declaration to cmd.h.
  * find.h: remove.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
c9e2a4400e Input complete: refactoring.
* (complete): rename to input_complete() and move declaration to
  input.h.
  * input_complete.h: remove.
  * (input_free_completions): rename to input_complete_free() and move
  definition to input_complete.c.
  * lib/widget/input_complete.c: rename variables and function from
  query_* to complete_*.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d12caa65d0 (dview_handle_key): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
d68c5c7e13 (help_handle_key): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
ec0c7cd848 (tree_key): fix key handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andreas Mohr
fbabe632a0 (user_group_button_cb): fix variable initialization.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
b0abfc8700 chmod: constify function arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
4314c04ede chmod: show mark of selected mode bits after dialog recreate.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
ab73f041a1 chmod_init: clear check_perm[].selected before use.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
baaef44dde src/filemanager/chmod.c: rename functions:
chmod_init -> chmod_dlg_create
chmod_i18n -> chmod_init

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
a00b7a672b src/filemanager/chown.c: rename functions:
chown_init -> chown_dlg_create
chown_i18n -> chown_init

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
ff1a52c229 src/filemanager/achown.c: rename functions:
advanced_chown_init -> advanced_chown_dlg_create
advanced_chown_i18n -> advanced_chown_init

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
8e51f583dc man2hlp: limited support of \fR, \fB, \fI, and \fP troff commands. 2020-05-17 18:48:18 +03:00
Andrew Borodin
cf1d4d80be src/editor/editcmd.c: minor refactoring and fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
7652b0f3cb (edit_draw_this_line): rename variable because it shadows previous one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
2ba413333b src/setup.c: use macros in keymap load/set/free functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
946e8d4888 Ticket #212: implement keybindings for radiobuttons.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
6fbf3d2ecd (toggle_subshell): clarify message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
9581c263b2 VFS: use mc_timer for timestamps.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
7a58b5e498 Ticket #4050: code cleanup before 4.8.25 release.
mcedit: unify messages.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:18 +03:00
Andrew Borodin
b36b9459d5 Ticket #4081: speed of file copy is not dispalyed for single file.
(panel_operate_init_totals): set ctx->progress_totals_computed to TRUE
in case of copy/move operation for single file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:42:13 +03:00
Elijah Zarezky
17a5ac322d src/filemanager/chattr.c: add missing comma.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-11 10:31:25 +03:00
Andrew Borodin
e14d44c839 Ticket #3847: chattr command implementattion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-05 19:06:18 +03:00
Andrew Borodin
bcdd81c628 WGroup: support colors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
2e734e5618 Make keybind map a member of Widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00
Andrew Borodin
c2aadb2ad5 WGroup: support mouse events.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-03-08 20:17:32 +03:00