bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dirspell and cdspell don't work when dealing with non-unixy filesystem s


From: Matteo Paolini
Subject: Dirspell and cdspell don't work when dealing with non-unixy filesystem structures
Date: Fri, 11 Feb 2022 18:11:33 +0100

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: msys
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='msys' -DCONF_MACHTYPE='x86_64-pc-msys'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS   -I.  -I. -I./include -I./lib
 -DWORDEXP_OPTION -Wno-discarded-qualifiers -march=x86-64
-mtune=generic -O2 -pipe -Wno-parentheses -Wno-format-security
-D_STATIC_BUILD -g
uname output: MINGW64_NT-10.0-22000 Ramanujan 3.3.3-341.x86_64
2022-01-17 11:45 UTC x86_64 Msys
Machine Type: x86_64-pc-msys

Bash Version: 4.4
Patch Level: 23
Release Status: release

Description:
In Git Bash, Windows volumes are represented as /<drive letter>.
This peculiarity appears to break the 'dirspell' and 'cdspell' options,
which fail when they try to correct a directory path which does not
follow the traditional unixy filesystem structure,
such as having users' home directories in '/home', even though a
possibly valid path might be available.

Repeat-By:
Consider this example proposed in this answer
https://stackoverflow.com/a/6438632:
1. open Git Bash an make sure sure that the current working directory
contains a drive letter in its path;
2. create a directory named 'spam/eggs' and a non-empty file 'spam/test';
3. ensure that the shell options 'dirspell', 'cdspell' and 'direxpand'
are active;
4. type the 'cat' command, giving it the test file's path as argument
and intentionally misspelling 'spam', then try to auto-complete the file's path;
5. try to 'cd' into 'spam/eggs/', but intentionally misspelling 'spam'.

You will notice that both steps 4 and 5 fail, even though they should
work on a proper Unix-like system.

Fix:
Workaround for the user: create symbolic links that follow the typical
unixy filesystem structure and point them to the directories you
usually use.
For instance, create a symbolic link named 'home' inside Git's
installation directory
(usually, 'C:\Program Files\Git'), which should point to 'C:\Users\'.
Then, modify your $HOME environment variable so that it contains the
path '/home/<username>'.
After 'cd'ing into $HOME, retry steps 4 and 5 of the previous sequence,
and you will notice that the directory spelling correction features
work as expected.

Long-term fix: if possible, allow 'dirspell' and 'cdspell' to
understand non-unixy filesystem structures.

Matteo Paolini



reply via email to

[Prev in Thread] Current Thread [Next in Thread]