PowerShell keyboard shortcuts for Windows mode and Emacs mode

This page lists the default key bindings of PSReadLine 2.3.6, the line-editing module behind the PowerShell prompt, under Microsoft's function names. The first column is Windows mode, the default on Windows; the second is Emacs mode, the default on Linux and macOS. Functions bound only in Emacs mode have their own section; Vi mode and unbound functions are left out. Some chords change meaning between modes: Ctrl + A selects the line in Windows mode and moves to its start in Emacs mode.

83 shortcuts in 7 sections. Checked row by row against Microsoft Learn on . Edited by Jay.

Basic editing 15

On a Mac, the Alt chords of Emacs mode work only after Terminal or iTerm2 is set to treat the Option key as Alt; the Esc sequences listed in the same cells do not use that key.

ActionWindows modeEmacs mode
AcceptLineRuns what is typed; unfinished input, such as an unclosed quote or bracket, gets a continuation prompt on a new line instead.EnterEnter
AddLineStarts another line under a continuation prompt without running anything, so several lines can go in as one command.Shift+EnterShift+Enter
InsertLineAboveOpens an empty line above the one being edited and puts the cursor at its start, wherever the cursor was.Ctrl+Enter—
InsertLineBelowOpens an empty line below the one being edited and puts the cursor at its start.Ctrl+Shift+Enter—
BackwardDeleteCharRemoves one character to the left of the cursor; in Emacs mode Ctrl + Backspace does the same instead of cutting a word.BackspaceorCtrl+HBackspaceorCtrl+BackspaceorCtrl+H
DeleteCharRemoves the character the cursor is on.DeleteDelete
BackwardKillWordDeletes from the start of the word up to the cursor; the removed text goes to the kill ring.Ctrl+BackspaceorCtrl+WAlt+BackspaceorEscthenBackspace
KillWordDeletes from the cursor up to the end of the word; the removed text goes to the kill ring.Ctrl+DeleteorAlt+DAlt+DorEscthenD
BackwardDeleteInputDeletes everything before the cursor, back to where the input begins, without adding it to the kill ring.Ctrl+Home—
ForwardDeleteInputDeletes everything after the cursor, up to where the input ends, without adding it to the kill ring.Ctrl+End—
UndoTakes back the most recent edit to the input.Ctrl+ZCtrl+_orCtrl+XthenCtrl+U
RedoRestores an edit that Undo took back; in Emacs mode the same chord runs Yank instead.Ctrl+Y—
RevertLineUndoes all edits at once, which clears typed input but leaves a line recalled from history as it was.EscAlt+RorEscthenR
DigitArgumentBuilds a number that multiplies the next function, so the digits 1 and 0 followed by # type ten # characters.Alt+0-9orAlt+-Alt+0-9orAlt+-
Toggle overwrite modeListed in Microsoft's line-editing help as switching between insert and overwrite typing; the PSReadLine function reference has no binding for it.Insert—

Cursor movement 9

ActionWindows modeEmacs mode
BackwardCharSteps the cursor one character left; at the start of a line it can move up to the line before.LeftLeftorCtrl+B
ForwardCharSteps the cursor one character right; at the end of a line it can move down to the line after.RightRightorCtrl+F
BackwardWordJumps to the beginning of the word under the cursor, or of the word before; the WordDelimiters setting decides where words break.Ctrl+LeftAlt+BorEscthenB
NextWordJumps ahead to where the following word begins; Emacs mode binds ForwardWord, which stops at word ends, instead.Ctrl+Right—
BeginningOfLineJumps to where the current line begins; pressed again in multi-line input, it jumps to the beginning of the whole input.HomeHomeorCtrl+A
EndOfLineJumps to where the current line stops; pressed again in multi-line input, it jumps to the very end of the input.EndEndorCtrl+E
GotoBraceJumps to the bracket, brace or parenthesis that pairs with the one at the cursor.Ctrl+]—
CharacterSearchReads one more key and searches forward for that character; a numeric argument asks for the nth occurrence.F3Ctrl+]
CharacterSearchBackwardReads one more key and searches backward for that character; a negative argument turns the search forward.Shift+F3Ctrl+Alt+]

Selection and clipboard 12

Microsoft prints the Copy binding as Ctrl+C with a capital C. In PSReadLine chord names a capital letter means Shift is held, so Copy is Ctrl + Shift + C while plain Ctrl + C runs CopyOrCancelLine. Alt + Shift + B in the Emacs column is printed as Alt+B for the same reason.

ActionWindows modeEmacs mode
SelectAllSelects the whole input line; Emacs mode uses this chord for BeginningOfLine instead.Ctrl+A—
SelectBackwardCharExtends the selection one character to the left.Shift+LeftShift+Left
SelectForwardCharExtends the selection one character to the right.Shift+RightShift+Right
SelectBackwardWordExtends the selection back over the word before the cursor.Ctrl+Shift+LeftAlt+Shift+B
SelectNextWordExtends the selection forward over the word after the cursor.Ctrl+Shift+Right—
SelectBackwardsLineExtends the selection from the cursor back to where the line starts.Shift+HomeShift+Home
SelectLineExtends the selection from the cursor forward to where the line ends.Shift+EndShift+End
SelectCommandArgumentSelects one argument of the command; pressing again moves to the following argument, ready to be replaced by typing.Alt+AAlt+A
CopyCopies the selected text to the system clipboard, or the entire line when nothing is selected.Ctrl+Shift+C—
CopyOrCancelLineCopies when text is selected; with no selection it cancels the line being typed.Ctrl+CCtrl+C
CutMoves the selected text to the system clipboard; in Emacs mode this chord only starts two-key sequences.Ctrl+X—
PasteInserts the clipboard in one piece, so multi-line text is parsed as a whole rather than line by line.Ctrl+VorShift+Insert—

History 8

ActionWindows modeEmacs mode
PreviousHistorySteps back one entry in PSReadLine history and puts it on the line in place of the current input.UpUporCtrl+P
NextHistorySteps forward one entry in PSReadLine history, replacing what is on the line.DownDownorCtrl+N
HistorySearchBackwardRecalls the previous history entry that begins with the text between the line start and the cursor.F8—
HistorySearchForwardMoves forward again through history entries that begin with the text left of the cursor.Shift+F8—
ReverseSearchHistoryStarts an incremental search backward through history; the match updates with each character typed.Ctrl+RCtrl+R
ForwardSearchHistoryStarts an incremental search toward newer history entries, the opposite direction of ReverseSearchHistory.Ctrl+SCtrl+S
YankLastArgInserts the last argument of the previous history line; repeated presses walk further back through history.Alt+.Alt+.orAlt+_orEscthen.orEscthen_
ClearHistoryEmpties the history kept by PSReadLine and leaves PowerShell's own history untouched.Alt+F7—

Completion and prediction 5

Outside Windows, Emacs mode starts with no key for MenuComplete: PSReadLine adds the Ctrl + Space binding of that mode on Windows only, so on Linux and macOS the function has to be bound by hand.

ActionWindows modeEmacs mode
TabCompleteNextFills in the next matching completion for the text at the cursor; Emacs mode gives this key to Complete instead.Tab—
TabCompletePreviousSteps back to the completion offered before the current one.Shift+Tab—
MenuCompleteShows the possible completions as a menu below the line; arrow keys choose one and Enter accepts it.Ctrl+SpaceorCtrl+@Ctrl+Space
SwitchPredictionViewFlips the prediction display between its two styles, InlineView and ListView.F2F2
ShowFullPredictionTooltipOpens the full tooltip for the prediction highlighted in the list view.F4F4

Screen and help 9

The four scroll bindings exist on Windows only, in both edit modes: PSReadLine does not create them on Linux or macOS.

ActionWindows modeEmacs mode
ClearScreenWorks like the cls or clear commands, but keeps the line being edited and redraws it at the top.Ctrl+LCtrl+L
ScrollDisplayUpScrolls the console view back by one screenful.Page UpPage Up
ScrollDisplayDownScrolls the console view forward by one screenful.Page DownPage Down
ScrollDisplayUpLineScrolls the console view up by a single line.Ctrl+Page UpCtrl+Page Up
ScrollDisplayDownLineScrolls the console view down by a single line.Ctrl+Page DownCtrl+Page Down
ShowCommandHelpOpens the cmdlet's full help in a pager on an alternate screen and returns to the same cursor position on exit.F1F1
ShowParameterHelpDisplays help for one parameter under the command line; the cursor must sit right after the full parameter name.Alt+HAlt+H
ShowKeyBindingsLists every key that currently has a function bound to it.Ctrl+Alt+?Ctrl+Alt+?
WhatIsKeyShows a what-is-key prompt, then names the function bound to the next chord pressed.Alt+?Alt+?

Additional Emacs bindings Emacs mode only 25

ActionWindows modeEmacs mode
KillLineCuts from the cursor to where the input ends and stores the text in the kill ring.—Ctrl+K
BackwardKillInputCuts everything before the cursor, back to where the input begins, into the kill ring.—Ctrl+UorCtrl+XthenBackspace
UnixWordRuboutCuts back to the start of the word into the kill ring; Windows mode gives this chord to BackwardKillWord.—Ctrl+W
YankInserts the last killed text into the input; Windows mode uses this chord for Redo.—Ctrl+Y
YankPopRight after a Yank, swaps the inserted text for the next entry of the kill ring.—Alt+YorEscthenY
YankNthArgInserts the first argument of the previous history line; a numeric argument picks another one, counting from 0.—Ctrl+Alt+YorEscthenCtrl+Y
SwapCharactersExchanges the character at the cursor with the one in front of it.—Ctrl+T
UpcaseWordChanges the following word to capital letters (new in version 2.3.0).—Alt+UorEscthenU
DowncaseWordChanges the following word to small letters (new in version 2.3.0).—Alt+LorEscthenL
CapitalizeWordGives the following word an initial capital and makes its other letters small (new in version 2.3.0).—Alt+CorEscthenC
DeleteCharOrExitRemoves the character the cursor is on; on an empty line it ends the PowerShell process instead.—Ctrl+D
ForwardWordJumps to the end of the word under the cursor, or of the following word when the cursor is between two.—Alt+ForEscthenF
SetMarkRemembers the cursor position as the mark that a later editing command can use.—Ctrl+@
ExchangePointAndMarkSwaps the two positions: the cursor jumps to the mark, and the mark takes the old cursor position.—Ctrl+XthenCtrl+X
SelectForwardWordExtends the selection to the end of the following word, moving the way ForwardWord does.—Alt+Shift+F
CompleteCompletes as far as the candidates agree; pressed again at that point, it lists the remaining choices.—Tab
PossibleCompletionsPrints the candidates that completion would offer for the text at the cursor.—Alt+=
BeginningOfHistoryJumps to the oldest entry of the history.—Alt+<
EndOfHistoryReturns from the history to its newest position, the input that was being typed.—Alt+>
AcceptAndGetNextRuns the input and, at the following prompt, recalls the history entry that came after it.—Ctrl+O
ValidateAndAcceptLineRuns the input the way AcceptLine does; incomplete input gets a continuation prompt.—Ctrl+M
AbortCancels the action in progress, such as an incremental history search.—Ctrl+G
ViEditVisuallyHands the command line to an external text editor, taken from the EDITOR or VISUAL environment variable.—Ctrl+XthenCtrl+E
ScrollDisplayTopScrolls the console view to its top; Windows mode uses this chord for BackwardDeleteInput.—Ctrl+Home
ScrollDisplayToCursorScrolls the console view back to the cursor; Windows mode uses this chord for ForwardDeleteInput.—Ctrl+End

Notes

PSReadLine is doing the work

Almost everything on this page is provided by PSReadLine, the line-editing module that ships with Windows PowerShell 5.1 and PowerShell 7. Because the bindings live in the module rather than in the console window, they behave the same whether you run PowerShell in Windows Terminal, the legacy console host, or the VS Code integrated terminal.

The history keys are where PSReadLine earns its keep. Ctrl + R opens an interactive reverse search that narrows as you type — the same muscle memory as Bash. F8 is the quieter alternative in Windows mode: type the first few characters of a command, then press it repeatedly to walk back through every history entry with that prefix. And Alt + . pulls the last argument of the previous command into the current line, which turns two-step sequences like mkdir then cd into a single keystroke.

Completion has two gears in Windows mode. Tab cycles through candidates one at a time, while Ctrl + Space opens a menu you can steer with the arrow keys — far better when a cmdlet has thirty parameters. Once a long command is on the line, Alt + A jumps selection from argument to argument so you can swap values without arrowing through the whole string, and a number typed with Alt + 0-9 repeats the next keystroke that many times.

Making it yours

Run Get-PSReadLineKeyHandler to list every active binding, or press Alt + ? followed by any chord to ask what that key does. If your muscle memory comes from Bash or Vim, Set-PSReadLineOption -EditMode Emacs (or Vi) swaps the whole keymap in one line — add it to your $PROFILE to make it permanent; on Linux and macOS, Emacs mode is already the default. The prediction view toggle on F2 requires PSReadLine 2.2.2 or newer; PowerShell 7.3 and later include it, while stock Windows PowerShell 5.1 needs Install-Module PSReadLine to catch up.

Questions

Why do some of these shortcuts not work in my terminal?

Three usual causes. The edit mode: Linux and macOS start in Emacs mode, where Windows-mode keys such as F8 are not bound, and on a Mac the Alt chords need a terminal that treats Option as Alt. Stock Windows PowerShell 5.1 ships an older PSReadLine, so newer functions like the F2 prediction toggle are missing until you update the module. And host applications can intercept chords before PSReadLine sees them — the VS Code terminal, for example, claims several Ctrl combinations for its own keybindings unless you configure it to pass them through.

What is the difference between Ctrl + R and F8?

Ctrl + R is an interactive search: a prompt appears and the match updates as you type, searching anywhere in the command. F8 is prefix-based recall: it uses whatever is already on your line as the starting text and steps backward through matching history entries, with Shift + F8 stepping forward again. Ctrl + R works in both edit modes; the two F8 keys are bound in Windows mode only.

How do I see every key binding at once?

Run Get-PSReadLineKeyHandler for the table of bound keys in the current edit mode; add -Bound -Unbound to include the functions that have no key. For a single key, press Alt + ? and then the chord you are curious about — PSReadLine reports which function it maps to without executing anything.

Can I make PowerShell behave like Bash?

Yes — Set-PSReadLineOption -EditMode Emacs enables the readline-style keymap that Bash users expect, and -EditMode Vi does the same for modal editing. Put the line in your $PROFILE so every new session starts with it. On Linux and macOS PowerShell already starts in Emacs mode, the second column of the tables.

What does the >> prompt mean after Shift + Enter?

Shift + Enter starts a new line without running the command, and PowerShell shows >> as a continuation prompt for each additional line. While editing multi-line input, pressing Home or End twice jumps to the very first or very last line of the whole block.

Sources and checks

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

6 rows from the earlier version of this page were removed in that check: duplicates, and bindings the documentation does not list or lists differently.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.