psmux_psmux/tests/disable_processed_input.ps1
Your Name aa133c378e fix: cursor disappearing after TUI exit + blank prompt on new window
- Never trust vt100 hide_cursor on Windows ConPTY - TUI apps killed via
  Ctrl+C leave both hide_cursor and alternate_screen stuck (cleanup
  sequences lost). Always report cursor visible in layout serialization.
- After Ctrl+C, feed ESC[?25h ESC[?1049l to parser to reset stuck
  alternate screen state and restore cursor visibility.
- Fix warm pane parser not resized when transplanted to new window -
  ConPTY was resized but vt100 parser stayed at old dimensions, causing
  blank content when window area differed from pre-spawn size.
- Applied fix in both layout serialization paths (serde + snap fast path),
  embedded rendering (rendering.rs), and all Ctrl+C handlers (server/mod.rs,
  input.rs embedded + send-keys paths).
2026-03-05 20:08:50 +05:30

23 lines
798 B
PowerShell

Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class ConMode {
[DllImport("kernel32.dll")] public static extern IntPtr GetStdHandle(int h);
[DllImport("kernel32.dll")] public static extern bool GetConsoleMode(IntPtr h, out uint m);
[DllImport("kernel32.dll")] public static extern bool SetConsoleMode(IntPtr h, uint m);
}
"@
$h = [ConMode]::GetStdHandle(-10)
$m = [uint32]0
[ConMode]::GetConsoleMode($h, [ref]$m)
Write-Host "Mode_Before: $m (0x$($m.ToString('X4')))"
# Disable ENABLE_PROCESSED_INPUT (bit 0)
$newMode = $m -band (-bnot 1)
[ConMode]::SetConsoleMode($h, $newMode)
[ConMode]::GetConsoleMode($h, [ref]$m)
Write-Host "Mode_After: $m (0x$($m.ToString('X4')))"
Write-Host "ENABLE_PROCESSED_INPUT is now OFF - simulating TUI app exit"