首页 > 解决方案 > Mac 终端自动完成提示文件不在当前目录中

问题描述

无论 termial 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  

编辑:我创建了一个新的管理员用户来查看问题是否仍然存在,但同样的错误也存在。

标签: macosterminalautocomplete

解决方案


如果您正在完成可执行文件,那就如预期的那样;完成遵循路径。如果您想在本地目录中完成,您可能必须./在点击完成键之前键入,因为经常.被排除在路径变量之外。

在这种情况下,完成是“智能的”,因为它采用它认为的上下文并使用它来确定你想要什么。在这种情况下,在行的开头,它认为你想要完成一个可以实际执行的命令,因此它只会在路径中找到东西。


推荐阅读