Ticket #4188 (closed defect: worksforme)
Warning: Cannot change to <path>.. with Fish shell
Reported by: | pronobis | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | mc-core | Version: | 4.8.26 |
Keywords: | Cc: | johannes | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description (last modified by andrew_b) (diff)
With mc 4.8.26, the support for the Fish shell improved considerably. However, every time I start mc, for a split second, the following warning shows up:
Warning: Cannot change to <path>..
Yet, the panels are pointing to the correct <path> and the shell pwd is also correct. So, in summary, this just seems to be an annoying message.
GNU Midnight Commander 4.8.26 Built with GLib 2.56.4 Built with S-Lang 2.3.2 with terminfo database With builtin Editor With subshell support as default With support for background operations With mouse support on xterm and Linux console With support for X11 events With internationalization support With multiple codepages support With ext2fs attributes support Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
Attachments
Change History
comment:1 Changed 4 years ago by andrew_b
- Version changed from master to 4.8.26
- Description modified (diff)
comment:2 Changed 4 years ago by pronobis
To add some more information, a related problem occurs when a command from the user menu is executed. It will work sometimes, but do nothing the first time the command is executed after the active window is changed or the mc window is resized. This problem, as well as the "cannot change to" problem described above is worked around by the attached patch.
comment:3 Changed 2 years ago by congest
The window resize bug that is referred to in this ticket is fixed by: http://midnight-commander.org/ticket/4372
mc_fish_first_command.diff doesn't seem to fix the "Cannot change..." error for me.
I poked around and eventually figured out why mc gives this error with fish. It seems like fish takes a second or two to start up, so it doesn't respond properly to mc at first. I tried to come up with a quick fix, but this quick fix has a side effect of making mc take a few seconds to start when running fish, which I think is much more annoying than a little error message.
comment:4 Changed 2 weeks ago by zaytsev
- Cc johannes added
Another fish one... Johannes, let me know if it annoys you when I put you on CC for fish issues.
comment:5 Changed 2 weeks ago by johannes
I can't reproduce the "Cannot change directory" error.
This is what I tried:
diff --git a/src/filemanager/cd.c b/src/filemanager/cd.c index 017d3ea81..6010f176b 100644 --- a/src/filemanager/cd.c +++ b/src/filemanager/cd.c @@ -303,6 +303,7 @@ cd_to (const char *path) void cd_error_message (const char *path) { + abort(); message (D_ERROR, MSG_ERROR, _("Cannot change directory to\n%s\n%s"), path, unix_error_string (errno)); } diff --git a/src/subshell/common.c b/src/subshell/common.c index 38cc11bcf..1151ffb58 100644 --- a/src/subshell/common.c +++ b/src/subshell/common.c @@ -430,7 +430,7 @@ init_subshell_child (const char *pty_name) case SHELL_FISH: execl (mc_global.shell->path, mc_global.shell->path, - "--init-command", "set --global __mc_csi_u 1", (char *) NULL); + "--init-command", "set --global __mc_csi_u 1; sleep 1", (char *) NULL); break; case SHELL_ASH_BUSYBOX: @@ -1794,6 +1794,7 @@ do_subshell_chdir (const vfs_path_t *vpath, gboolean update_prompt) char *cwd; cwd = vfs_path_to_str_flags (subshell_get_cwd (), 0, VPF_STRIP_PASSWORD); + abort(); vfs_print_message (_("Warning: Cannot change to %s.\n"), cwd); g_free (cwd); }