简体   繁体   English

如何使 Powershell 像 Linux/Unix 系统或“cmd” shell 一样自动完成?

[英]How to make Powershell autocomplete like Linux/Unix systems or “cmd” shell?

Situation情况

Every time that I hit TAB key the Powershell completes with an .\ at the begging of the completed word.每次我按 TAB 键时,Powershell 都会在完成单词的乞求时以.\结尾。


Example例子

I have one file named Test.jar and I will use mv command to change the name of the file to any other.我有一个名为Test.jar的文件,我将使用mv命令将文件名更改为其他文件名。 If I press TAB while typing the existing file it's look like:如果我在输入现有文件时按 TAB,它看起来像:

$ mv .\Test.jar ...

Have I way that I could change the autocompletion behavior?我有办法改变自动完成行为吗?

Some would argue that the PowerShell Autocomplete behavior is "more" correct, and "syntactically better" than bash or equivalent having a plain file name.有人会争辩说,PowerShell 自动完成行为比 bash 或具有纯文件名的等效项“更”正确,并且“语法更好”。

When it adds .\ to the beginning, it doesn't affect functionality.当它将.\添加到开头时,它不会影响功能。 It is clarifying what you are entering.它正在澄清您输入的内容。 It both clarifies that:它都澄清了:

  1. You are working with a File Name as opposed to a command ie If you have a file named "mv", you could see that it is a file that you are working with.您正在使用文件名而不是命令,即如果您有一个名为“mv”的文件,您可以看到它是您正在使用的文件。
  2. It is clarifies that the location of the file is located in the current working directory.明确文件的位置位于当前工作目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 WiFi 切换 Linux shell 脚本翻译到 Windows10 CMD 或 Z3D265B4E13EEB10DDF17881FA0 - Translating WiFi switching Linux shell script to Windows10 CMD or PowerShell 如何在PowerShell中将参数传递给类似Unix的命令(通过MinGW) - How to pass arguments to Unix-like commands (via MinGW) in PowerShell Unix / Linux系统是否容易泄漏全局内核对象? - Are Unix/Linux systems vulnerable to leaking global kernel objects? Powershell脚本相当于Unix“shell函数” - Powershell script equivalent of Unix “shell function” 在Windows和类Unix系统之间有区别的Makefile - Makefile that distincts between Windows and Unix-like systems 如何在 CMD 中运行 PowerShell - How to run PowerShell in CMD 我如何像在Linux上那样在Windows系统上设法在python-dev中安装软件包? - How can I manage to install packages within python-dev on windows systems just like that on Linux? 帮助我使我的Windows cmd.exe控制台更像Linux终端 - Help me make my windows cmd.exe console work more like a Linux terminal POWERSHELL - WINDOWS REGISTRY - 如何使用“*”路径,如 'hkcr:\\*\\shell' - POWERSHELL - WINDOWS REGISTRY - How to have path with "*" like 'hkcr:\*\shell' 如何在Windows上使用Linux-Like Shell(bash)进行开发? - How to develop in Linux-Like Shell (bash) on Windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM