xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 9cf8260accd8250c822e2edaa5e9795da3735e3b

Fix :open not entering dir symlinks sometimes
Specifically if there is no "vifm" executable in $PATH.

The behaviour is related to the handling of VIFM_PSEUDO_CMD, but it
works the same for directories and symbolic links to directories. The
real difference was in the special handling within
running.c:run_with_defaults().

Thanks to CaptainFantastic.

See https://q2a.vifm.info/2392/behavior-enter-key which needed `cd %c`
workaround until this fix.
Author: xaizek
Author date (UTC): 2026-03-17 10:10
Committer name: xaizek
Committer date (UTC): 2026-03-21 13:54
Parent(s): 46a934717791b97ad82420d7b3840ba0cbac1c9d
Signing key: 99DC5E4DB05F6BE2
Tree: 830bf3ceef3f8d7de6dfe954548d36fb076cd4fb
File Lines added Lines deleted
ChangeLog 3 0
src/running.c 1 1
tests/misc/running.c 32 0
File ChangeLog changed (mode: 100644) (index 5bc0f2d19..c6909c694)
213 213 link and simultaneously logging partial name in the undo history message, link and simultaneously logging partial name in the undo history message,
214 214 which is merely informative. which is merely informative.
215 215
216 Fixed :open not entering symbolic links to directories if there is no
217 "vifm" executable in $PATH. Thanks to CaptainFantastic.
218
216 219 0.14-beta to 0.14 (2025-02-08) 0.14-beta to 0.14 (2025-02-08)
217 220
218 221 Improved documentation on zh/zl menu keys a bit. Improved documentation on zh/zl menu keys a bit.
File src/running.c changed (mode: 100644) (index 2306d43de..0cfb31abd)
... ... run_selection(view_t *view, int dont_execute)
467 467 static void static void
468 468 run_with_defaults(view_t *view) run_with_defaults(view_t *view)
469 469 { {
470 if(get_current_entry(view)->type == FT_DIR)
470 if(fentry_is_dir(get_current_entry(view)))
471 471 { {
472 472 (void)rn_enter_dir(view); (void)rn_enter_dir(view);
473 473 return; return;
File tests/misc/running.c changed (mode: 100644) (index 675ef5802..8f82238be)
24 24 #include "../lua/asserts.h" #include "../lua/asserts.h"
25 25
26 26 static int prog_exists(const char name[]); static int prog_exists(const char name[]);
27 static int prog_does_not_exist(const char name[]);
27 28 static void start_use_script(void); static void start_use_script(void);
28 29 static void stop_use_script(void); static void stop_use_script(void);
29 30 static void assoc_script(const char pattern[], const char param[], char macro); static void assoc_script(const char pattern[], const char param[], char macro);
 
... ... TEST(can_open_via_plugin)
131 132 curr_stats.vlua = NULL; curr_stats.vlua = NULL;
132 133 } }
133 134
135 TEST(can_open_symlinked_directory, IF(not_windows))
136 {
137 ft_init(&prog_does_not_exist);
138
139 create_dir(SANDBOX_PATH "/dir");
140 assert_success(make_symlink("dir", SANDBOX_PATH "/link"));
141
142 make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, "", cwd);
143 populate_dir_list(&lwin, /*reload=*/0);
144
145 assert_int_equal(2, lwin.list_rows);
146 lwin.list_pos = 1;
147 lwin.dir_entry[lwin.list_pos].marked = 1;
148 lwin.pending_marking = 1;
149 assert_string_equal("link", lwin.dir_entry[lwin.list_pos].name);
150
151 rn_open(&lwin, FHE_RUN);
152 assert_success(chdir(cwd));
153
154 assert_true(paths_are_same(lwin.curr_dir, SANDBOX_PATH "/dir"));
155
156 remove_file(SANDBOX_PATH "/link");
157 remove_dir(SANDBOX_PATH "/dir");
158 }
159
134 160 TEST(following_resolves_links_in_origin, IF(not_windows)) TEST(following_resolves_links_in_origin, IF(not_windows))
135 161 { {
136 162 assert_success(os_mkdir(SANDBOX_PATH "/A", 0700)); assert_success(os_mkdir(SANDBOX_PATH "/A", 0700));
 
... ... prog_exists(const char name[])
620 646 return 1; return 1;
621 647 } }
622 648
649 static int
650 prog_does_not_exist(const char name[])
651 {
652 return 0;
653 }
654
623 655 static void static void
624 656 start_use_script(void) start_use_script(void)
625 657 { {
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master