macos - 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
编辑:我创建了一个新的管理员用户来查看问题是否仍然存在,但同样的错误也存在。
解决方案
如果您正在完成可执行文件,那就如预期的那样;完成遵循路径。如果您想在本地目录中完成,您可能必须./
在点击完成键之前键入,因为经常.
被排除在路径变量之外。
在这种情况下,完成是“智能的”,因为它采用它认为的上下文并使用它来确定你想要什么。在这种情况下,在行的开头,它认为你想要完成一个可以实际执行的命令,因此它只会在路径中找到东西。
推荐阅读
- amazon-web-services - AWS-ElasticBeanstalk:在哪里可以找到 Beanstalk 自动创建的域名指向什么?
- python - 我该如何解决这个 pyinstaller 问题?
- distributed-computing - 将 ReadableStream 存储在 Cloudflare Workers KV 等分布式数据存储中的用例有哪些?
- swiftui - 有没有办法将 swiftUI 视图加载到 NSView 中?
- html - 为什么 jquery 每次点击都会增量运行?
- ruby - VSCode solargraph 提供程序在 Ruby 2.2.2 上失败
- r - knitr 缓存和 ggplot2::last_plot()
- android-source - lldb 将我的远程 aarch64 平台报告为 x86_64 (AOSP)
- angular - 角度路由将我锁定在一个组件中,我无法路由出当前 url
- php - Bootstrap 列和 Wordpress 帖子