Mac 终端自动完成提示文件不在当前目录中
Mac terminal auto-complete is suggesting files not in current directory
无论 terminal promt 在文件系统中的什么位置,它只建议来自 bin 或 sbin 目录的可执行文件。
看看这个:
Last login: Sun Apr 26 15:24:57 on ttys004
You have mail.
box:~ mee$ A
AppleFileServer AssetCacheLocatorUtil AssetCacheManagerUtil AssetCacheTetheratorUtil
box:~ mee$ which AppleFileServer
/usr/sbin/AppleFileServer
box:~ mee$
Display all 2636 possibilities? (y or n)
box:~ mee$ cd ~/Desktop/wp-content/
box:wp-content mee$ ls
index.php languages plugins themes upgrade uploads
box:wp-content mee$
Display all 2636 possibilities? (y or n)
box:wp-content mee$ A
AppleFileServer AssetCacheLocatorUtil AssetCacheManagerUtil AssetCacheTetheratorUtil
编辑:我已经创建了一个新的管理员用户来查看问题是否仍然存在,但同样的错误也存在。
如果您正在完成可执行文件,这符合预期;完成遵循路径。如果你想在本地目录中完成,你可能必须在按下完成键之前键入 ./
,因为 .
经常被排除在路径变量之外。
在这种情况下,完成是 "smart",因为它采用它认为是上下文的内容并使用它来确定您想要的内容。在这种情况下,在行的开头,它认为你要完成一个实际可以执行的命令,因此它只会查找路径中的东西。
无论 terminal promt 在文件系统中的什么位置,它只建议来自 bin 或 sbin 目录的可执行文件。
看看这个:
Last login: Sun Apr 26 15:24:57 on ttys004
You have mail.
box:~ mee$ A
AppleFileServer AssetCacheLocatorUtil AssetCacheManagerUtil AssetCacheTetheratorUtil
box:~ mee$ which AppleFileServer
/usr/sbin/AppleFileServer
box:~ mee$
Display all 2636 possibilities? (y or n)
box:~ mee$ cd ~/Desktop/wp-content/
box:wp-content mee$ ls
index.php languages plugins themes upgrade uploads
box:wp-content mee$
Display all 2636 possibilities? (y or n)
box:wp-content mee$ A
AppleFileServer AssetCacheLocatorUtil AssetCacheManagerUtil AssetCacheTetheratorUtil
编辑:我已经创建了一个新的管理员用户来查看问题是否仍然存在,但同样的错误也存在。
如果您正在完成可执行文件,这符合预期;完成遵循路径。如果你想在本地目录中完成,你可能必须在按下完成键之前键入 ./
,因为 .
经常被排除在路径变量之外。
在这种情况下,完成是 "smart",因为它采用它认为是上下文的内容并使用它来确定您想要的内容。在这种情况下,在行的开头,它认为你要完成一个实际可以执行的命令,因此它只会查找路径中的东西。