mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-21 06:41:16 -03:00
Always use "." for cd
Nobody doesn't want to use $PWD to cd, so if $CDPATH does not include it that was a mistake. Bash also appends "." here. Fixes #4484.
This commit is contained in:
@@ -173,9 +173,8 @@ maybe_t<wcstring> path_get_cdpath(const wcstring &dir, const wcstring &wd,
|
||||
if (auto cdpaths = env_vars.get(L"CDPATH")) {
|
||||
cdpathsv = cdpaths->as_list();
|
||||
}
|
||||
if (cdpathsv.empty()) {
|
||||
cdpathsv.push_back(L".");
|
||||
}
|
||||
// Always append $PWD
|
||||
cdpathsv.push_back(L".");
|
||||
for (wcstring next_path : cdpathsv) {
|
||||
if (next_path.empty()) next_path = L".";
|
||||
if (next_path == L"." && !wd.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user