@@ -9,6 +9,7 @@ import { Global } from "../../src/global"
99import { Filesystem } from "../../src/util/filesystem"
1010
1111const managedConfigDir = process . env . OPENCODE_TEST_MANAGED_CONFIG_DIR !
12+ const wintest = process . platform === "win32" ? test : test . skip
1213
1314beforeEach ( async ( ) => {
1415 await Config . invalidate ( true )
@@ -441,6 +442,53 @@ test("merges keybind overrides across precedence layers", async () => {
441442 } )
442443} )
443444
445+ wintest ( "defaults Ctrl+Z to input undo on Windows" , async ( ) => {
446+ await using tmp = await tmpdir ( )
447+
448+ await Instance . provide ( {
449+ directory : tmp . path ,
450+ fn : async ( ) => {
451+ const config = await TuiConfig . get ( )
452+ expect ( config . keybinds ?. terminal_suspend ) . toBe ( "none" )
453+ expect ( config . keybinds ?. input_undo ) . toBe ( "ctrl+z,ctrl+-,super+z" )
454+ } ,
455+ } )
456+ } )
457+
458+ wintest ( "keeps explicit input undo overrides on Windows" , async ( ) => {
459+ await using tmp = await tmpdir ( {
460+ init : async ( dir ) => {
461+ await Bun . write ( path . join ( dir , "tui.json" ) , JSON . stringify ( { keybinds : { input_undo : "ctrl+y" } } ) )
462+ } ,
463+ } )
464+
465+ await Instance . provide ( {
466+ directory : tmp . path ,
467+ fn : async ( ) => {
468+ const config = await TuiConfig . get ( )
469+ expect ( config . keybinds ?. terminal_suspend ) . toBe ( "none" )
470+ expect ( config . keybinds ?. input_undo ) . toBe ( "ctrl+y" )
471+ } ,
472+ } )
473+ } )
474+
475+ wintest ( "ignores terminal suspend bindings on Windows" , async ( ) => {
476+ await using tmp = await tmpdir ( {
477+ init : async ( dir ) => {
478+ await Bun . write ( path . join ( dir , "tui.json" ) , JSON . stringify ( { keybinds : { terminal_suspend : "alt+z" } } ) )
479+ } ,
480+ } )
481+
482+ await Instance . provide ( {
483+ directory : tmp . path ,
484+ fn : async ( ) => {
485+ const config = await TuiConfig . get ( )
486+ expect ( config . keybinds ?. terminal_suspend ) . toBe ( "none" )
487+ expect ( config . keybinds ?. input_undo ) . toBe ( "ctrl+z,ctrl+-,super+z" )
488+ } ,
489+ } )
490+ } )
491+
444492test ( "OPENCODE_TUI_CONFIG provides settings when no project config exists" , async ( ) => {
445493 await using tmp = await tmpdir ( {
446494 init : async ( dir ) => {
0 commit comments