Skip to content

Commit 4ca396e

Browse files
Remove the comments added by this change
1 parent a3c5ee6 commit 4ca396e

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

app/assets/bundled/bootstrap/pwsh.ps1

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,19 +351,9 @@ $null = New-Module -Name Warp-Module -ScriptBlock {
351351
# it is set to $false.
352352
$script:commandNotFound = $false
353353

354-
# Reports the user's vi preference in the 'Bootstrapped' payload even though the session's
355-
# live edit mode is overridden. See Warp-Configure-PSReadLine.
356354
$script:viEditModeOverridden = $false
357355

358356
function Warp-Configure-PSReadLine {
359-
# The 'Alt+1' and 'Alt+2' chords below reach PSReadLine as a bare Escape plus a digit, and
360-
# a chord split across reads -- which ConPTY readily produces -- never dispatches. Emacs
361-
# swallows the stray Escape, but Vi binds it to ViCommandMode, so everything Warp writes
362-
# next is reinterpreted as vi edits and 'echo hello' submits as 'o hello'. Only vi is
363-
# overridden, because only vi corrupts the command; the milder stray-digit damage under
364-
# the 'Windows' edit mode is GH #10891. The override costs a vi user nothing they can see,
365-
# since a Warpified session's keystrokes go through Warp's input editor rather than
366-
# PSReadLine's, and it must precede the bindings because it resets every key handler.
367357
if ((Get-PSReadLineOption).EditMode -eq 'Vi') {
368358
$script:viEditModeOverridden = $true
369359
Set-PSReadLineOption -EditMode Emacs
@@ -974,8 +964,6 @@ $null = New-Module -Name Warp-Module -ScriptBlock {
974964

975965
function Warp-Finish-Bootstrap {
976966
param([decimal]$rcStartTime, [decimal]$rcEndTime)
977-
# The profiles just sourced ran after the bootstrap's own Warp-Precmd, and setting the vi
978-
# edit mode there unbinds Warp's chords by resetting every key handler.
979967
Warp-Configure-PSReadLine
980968

981969
# This is the closest we can get in PowerShell to a proper preexec hook. We wrap the

crates/integration/src/test/bootstrapping.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,7 @@ zle -N zle-line-init
365365
}
366366

367367
/// Regression test for CORE-3804: a profile that selects PSReadLine's vi edit mode must not
368-
/// corrupt submitted commands. Warp's input-reporting and kill-buffer chords reach PSReadLine as
369-
/// a bare Escape plus a digit, which vi binds to ViCommandMode and DigitArgument, so before the
370-
/// fix a submitted `echo hello` arrived as `o hello`.
368+
/// corrupt submitted commands.
371369
pub fn test_pwsh_vi_edit_mode_does_not_corrupt_commands() -> Builder {
372370
new_builder()
373371
.set_should_run_test(|| {
@@ -390,8 +388,6 @@ pub fn test_pwsh_vi_edit_mode_does_not_corrupt_commands() -> Builder {
390388
ExpectedExitStatus::Success,
391389
"vi_edit_mode_ok",
392390
))
393-
// The leading token is what vi command mode eats first, so a second command guards the
394-
// failure mode where only part of the text survives.
395391
.with_step(execute_command_for_single_terminal_in_tab(
396392
0,
397393
"Write-Output second_command_ok".to_string(),

0 commit comments

Comments
 (0)