Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I type a TAB character in PowerShell?

Task: By default, pressing the TAB key while in Windows Command Prompt will output file names, while it does nothing in PowerShell. I want to be able to type the TAB character in interactive mode, not via scripts.

Research: I found similar questions on this site and via Google search. Solutions found were addressing Bash (Mac) or iterm (Linux), or suggested changing to another program such as TweakUI. My question is specific to Windows PowerShell or Command Prompt.

Clarification: A simple test for whether your answer works for my question is to type echo "1 TAB-method 2" into PS/CP, where TAB-method is your suggestion on how to insert a TAB character. If the echo gives 1 2 (i.e., 1 followed by a TAB space followed by 2). That's what I'm looking for.

like image 222
Hamman Samuel Avatar asked Dec 19 '13 20:12

Hamman Samuel


People also ask

How do I add a tab in PowerShell?

To create and use a new PowerShell TabOn the File menu, click New PowerShell Tab. The new PowerShell tab always opens as the active window. PowerShell tabs are incrementally numbered in the order that they are opened. Each tab is associated with its own Windows PowerShell console window.

What does Tab key do in PowerShell?

So, I thought, if this person didn't know what function the Tab key provided, maybe some of you might not, too. Using the Tab keyboard key in an open PowerShell command window allows you to scroll through commands. Just enter a single letter, hit the Tab key on the keyboard repeatedly, and watch the magic.

How do you get tab characters?

Unlike with HTML space, there is no particular HTML tab character you could use. You could technically use the 	 entity as the tab is character 9 in the ASCII.


1 Answers

If it helps, you can embed a tab character in a double-quoted string:

"`t hello" 
like image 54
Shay Levy Avatar answered Oct 06 '22 00:10

Shay Levy