Commit Graph

15933 Commits

Author SHA1 Message Date
Andrew Borodin 44666f378a (tree_move): fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin 48c5428b0f (info_show_info): don't create VFS path if EXT2 attributes aren't supported.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin d201e9cdac file_op_context_t: remove op_preserve member.
(file_mask_dialog): use local variable instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin d6f6c29c0b (shell_execute): fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin 059cd9569f (tar_seek_archive): improve diagnostic for truncated archive.
If EOF has been read, don't attempt to seek past it.

Sync with GNU tar 21318f385627a30da5d92811dd80f70abbe80ee7.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin 1bae2c678f Move OS-specific stuff from lib/global.h to lib/unixcompat.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin a2f65852e3 Merge lib/utilunix.h into lib/util.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin aa38245e85 Merge lib/strescape.h into lib/strutil.h. Rename functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin 933b111a5d Set the default IO size to 256KiB.
src/filemanager/ioblksize.h: Add updated test results and increase value
from 128KiB to 256KiB.

This was previously 128KiB and increasing to 256KiB was seen to increase
throughput by 10-20% when reading cached files on modern systems.

Sync with GNU coreutils fcfba90d0d27a1bacf2020bac4dbec74ed181028.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin 93a4b2ab79 (find_cmd): add intermediate variable to simplify formatting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin 258b52b2d1 mceditor: massive use of edit_arg_t as function argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:38:11 +03:00
Andrew Borodin e79e76b72b mceditor: new APIs.
* (edit_arg_init): initialize edit_arg_t object.
  * (edit_arg_assign): Apply new values to edit_arg_t object members.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 54bdd0efbf mceditor: drop edit_stack_type. Use edit_arg_t instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin ac41da50ee (edit_get_file_name): move from editwidget.c to edit.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin dae33eb229 mceditor: refactoring.
* (mcedit_arg_t): rename to edit_arg_t and move to src/editor/edit.h.
  * (mcedit_arg_free): rename to edit_arg_free() and move to src/editor/edit.c.
  * (mcedit_arg_vpath_new): rename to edit_arg_vpath_new(), move to src/editor/edit.c
  and make public.
  * (mcedit_arg_new): rename to edit_arg_new(), move to src/editor/edit.c
  and make public.
  * src/editor/editwidget.c: sync with new editor APIs.
  * src/main.c: likewise.
  * src/args.c: likewise.
  * (mc_args_parse): show error in case of run MC as "mc -e" if MC is built
    without builtin editor.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin f9a2038991 textconf.c: features: fix capital letters.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 228166b73b (dview_init): move first run of redo_diff() to diff_view().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin eceab3900d (create_panel): reduce variable scope.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin fe47ac5b56 (mcview_new): use WRect to define a panel area.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin d16ca7a1f5 Modify WTree creation API.
* (tree_init): use WRect to define widget area.
 * (create_panel): sync with modified API.
 * (tree_box): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 46dde8697b (info_new): use WRect to define a panel area.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin be148a0578 Change the file list panel creation APIs.
* (panel_sized_empty_new): use WRect to define a panel area.
  * (panel_sized_with_dir_new): likewise.
  * (panel_sized_new): likewise.
  * (panel_empty_new): sync with modified API.
  * (panel_with_dir_new): likewise.
  * (panel_sized_with_dir_new): likewise.
  * (create_panel): likewise.
  * (restore_into_right_dir_panel): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 8bb12a40e6 (put_tagged): trivial refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 41fadeffe7 (check_panel_timestamp): constify arguments, simplify checks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 9584973453 (mc_build_filenamev): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:06:16 +03:00
Andrew Borodin 0c53039155 Don't create and install diff viewer man page if mc is built --without-diff-viewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:05:48 +03:00
Andrew Borodin 3958e1e68f Don't create and install mcedit man page if mc is built --without-internal-edit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:03:37 +03:00
Andrew Borodin 7af11660f8 Clean up irrelevant comments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:01:47 +03:00
Andrew Borodin de4e6ca534 src/editor/editmenu.c: includes cleanup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:01:47 +03:00
Dmitry Atamanov 9fb4261334 mcedit: update C and C++ syntax highlightings.
Closes MidnightCommander/mc#195.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:01:47 +03:00
Andrew Borodin 3291dd248f (edit_get_search_line_type): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:01:47 +03:00
Viktor Szakats f3ffb28737 Ticket #4524: code cleanup before 4.8.32 release.
mcedit: fix losing column position when navigating up/down.
Regression from 49bc0ddebf.

Closes MidnightCommander/mc#194.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-04-07 16:01:47 +03:00
Andrew Borodin 7b3c427c85 Merge branch '4533_external_editor_tokens'
* 4533_external_editor_tokens:
  Ticket #4533: External editor does not work with arguments in $EDITOR
2024-04-07 15:52:04 +03:00
Andrew Borodin 44d8213f4e Ticket #4533: External editor does not work with arguments in $EDITOR
When using an external editor (i.e. "Use internal edit" in the Configure
Options is unchecked) the environment variable EDITOR is used. However,
if $EDITOR contains a command line argument after the executable name,
these arguments are not processed properly, and the editor might not be
started at all.

How to reproduce: (Precondition: vi is available on the system)
  1) On the command line, execute: export EDITOR="vi +" && mc
(the + argument should let vi start at the document's end instead of the
beginning).
  2) Go to the Options menu -> Configuration -> uncheck "Use internal
edit".
  3) Move the cursor to a file that is larger than a single screen (e.g.
ABOUT-NLS in mc's source directory).
  4) Press F4 to start the external editor.

Result: Nothing visible happens

Expected result: vi is opened showing the end of the file ABOUT-NLS

The bug: my_system_make_arg_array() doesn't perform full-feature
parsing of the comman line.

  * (str_tokenize): mew function based on history_tokenize_internal()
from GNU readline-8.2.
  * (str_tokenize_word): mew function based on history_tokenize_word()
from GNU readline-8.2.
  * (my_system_make_arg_array): reimplement using str_tokenize().
  * (my_systemv_flags): use modified my_system_make_arg_array().
  * (fork_child_tokens): new test for string tokenization.
  * (fork_child_tokens2): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-31 19:04:26 +03:00
Andrew Borodin 25f008c0b0 Merge branch '4532_copy_move_attrs'
* 4532_copy_move_attrs:
  mceditor: support ext2fs attributes.
  Ticket #4451: preserve ext2fs attributes on copy/move operations.
2024-03-31 18:48:21 +03:00
Andrew Borodin 16fadb9d02 mceditor: support ext2fs attributes.
Get attributes on file open and set ones on file save.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-31 18:46:46 +03:00
Andrew Borodin f6f7c8c1ce Ticket #4451: preserve ext2fs attributes on copy/move operations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-31 18:46:46 +03:00
Andrew Borodin 293e534f3e Merge branch '4530_skins'
* 4530_skins:
  skins: add modarin256 thin and root variant.
  skins: add modarcon16 thin and root variant.
  skins: add xoria thin and root variant.
  Ticket #4530: new skins.
2024-03-23 10:14:50 +03:00
Eugene San (eugenesan) ad2431c40f skins: add modarin256 thin and root variant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-23 09:47:33 +03:00
Eugene San (eugenesan) 7b9e2db5cf skins: add modarcon16 thin and root variant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-23 09:47:29 +03:00
Eugene San (eugenesan) 2f4d7095f4 skins: add xoria thin and root variant.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-23 09:29:46 +03:00
Eugene San (eugenesan) 5d64768e22 Ticket #4530: new skins.
Initial commit: xoria256.ini: clean up.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-03-23 09:23:43 +03:00
Andrew Borodin d792f707fc Merge branch '4224_mcdiff_man'
* 4224_mcdiff_man:
  Ticket #4224: add mcdiff manual page.
2024-02-24 10:14:02 +03:00
Denys Vlasenko 4092ea8bbe Ticket #4224: add mcdiff manual page.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-02-24 10:13:41 +03:00
Andrew Borodin 6b44fce839 Merge branch '3088_terminal_cwd'
* 3088_terminal_cwd:
  Use ESC_STR macro in escape sequences.
  (update_xterm_title_path): change the escape sequence's terminator
  Ticket #3088: tell the current directory to the terminal
2024-02-11 19:28:07 +03:00
Andrew Borodin c3ffd4a790 Use ESC_STR macro in escape sequences.
* (update_xterm_title_path): use ESC_STR macro.
  * (update_terminal_cwd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-02-11 19:26:45 +03:00
Egmont Koblinger e777f75397 (update_xterm_title_path): change the escape sequence's terminator
...from \a to \e\\. Various standards (at least ECMA-48 and DEC STD 070)
agree that an OSC is to be terminated by an ST, i.e. \e\\. Using BEL \a
is a nonstandard solution introduced and popularized by xterm.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-02-11 19:26:45 +03:00
Egmont Koblinger 5e9fac5c94 Ticket #3088: tell the current directory to the terminal
...using OSC 7 sequence, so it can open new tabs there.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-02-11 19:26:45 +03:00
Andrew Borodin dc1aa3e4e3 Merge branch '4521_fish_history'
* 4521_fish_history:
  Ticket #4521: really escape fish shell history.
2024-02-11 19:20:55 +03:00
Anton Anikin ae4553442f Ticket #4521: really escape fish shell history.
Some of the "service" commands generated by the mc "leak" into the fish
subshell history available to the user. An example to reproduce:

  *  set user shell to fish and start mc (SHELL=/usr/bin/fish mc)
  *  navigate to any directory
  *  press Ctrl+o
  *  press \u2191 button (UP, go back in history)
  *  observe " cd (printf '%b' ... " command

This commit avoids the " cd (printf '%b' ... " commands in the fish
history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-02-11 19:19:40 +03:00