Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions TerminalDocs/tutorials/shell-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,26 @@ function prompt {
if ($Global:__LastHistoryId -ne -1) {
if ($LastHistoryEntry.Id -eq $Global:__LastHistoryId) {
# Don't provide a command line or exit code if there was no history entry (eg. ctrl+c, enter on no command)
$out += "`e]133;D`a"
$out += "$([char]0x1b)]133;D$([char]07)"
} else {
$out += "`e]133;D;$gle`a"
$out += "$([char]0x1b)]133;D;$gle$([char]07)"
}
}


$loc = $($executionContext.SessionState.Path.CurrentLocation);

# Prompt started
$out += "`e]133;A$([char]07)";
$out += "$([char]0x1b)]133;A$([char]07)";

# CWD
$out += "`e]9;9;`"$loc`"$([char]07)";
$out += "$([char]0x1b)]9;9;`"$loc`"$([char]07)";

# (your prompt here)
$out += "PWSH $loc$('>' * ($nestedPromptLevel + 1)) ";

# Prompt ended, Command started
$out += "`e]133;B$([char]07)";
$out += "$([char]0x1b)]133;B$([char]07)";

$Global:__LastHistoryId = $LastHistoryEntry.Id

Expand Down