mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
7866bf7342
If you navigate in your shell to a directory containing symlinks and then start mc, mc will show the canonical path instead. It would be nice to make it show the directory with the symlinks. Example: in your shell execute these: user:~$ mkdir -p /tmp/a/b /tmp/x ; ln -s /tmp/a/b /tmp/x/y user:~$ cd /tmp/x/y user:/tmp/x/y$ mc In mc you'll find yourself in /tmp/a/b, though it'd be nicer to see /tmp/x/y at the top, and correspondingly navigating to the parent would take you to /tmp/x. If you start bash or zsh from /tmp/x/y, the new instance will start displaying the working directory as such. They do this via the PWD env variable. On one hand, they set and maintain PWD to point to the current directory, using the path as specified by the user (possibly containing symbolic links). On the other hand, they check its value at startup. If $PWD points to the same physical directory as the actual working directory then they use this value. If $PWD points somewhere else then it's simply ignored (so it's a hint only as to which symlinks to use to get to the working directory, but never alters the actual cwd). Now mc also does the same at startup (with respect of "Cd follows links" option). Relative directories specified in the command line are applied after possibly replacing the canonical cwd with $PWD. This way for example user:/tmp/x/y$ mc . .. opens two panels in /tmp/x/y and /tmp/x instead of /tmp/a/b and /tmp/a (whereas /tmp/x is actually a different directory than /tmp/a). Signed-off-by: Andrew Borodin <aborodin@vmail.ru> |
||
---|---|---|
.. | ||
event | ||
filehighlight | ||
mcconfig | ||
search | ||
skin | ||
strutil | ||
tty | ||
vfs | ||
widget | ||
charsets.c | ||
charsets.h | ||
event-types.h | ||
event.h | ||
filehighlight.h | ||
fileloc.h | ||
fs.h | ||
glibcompat.c | ||
glibcompat.h | ||
global.c | ||
global.h | ||
hook.c | ||
hook.h | ||
keybind.c | ||
keybind.h | ||
lock.c | ||
lock.h | ||
logging.c | ||
logging.h | ||
Makefile.am | ||
mcconfig.h | ||
search.h | ||
serialize.c | ||
serialize.h | ||
skin.h | ||
strescape.h | ||
strutil.h | ||
timefmt.c | ||
timefmt.h | ||
unixcompat.h | ||
util.c | ||
util.h | ||
utilunix.c | ||
utilunix.h | ||
widget.h |