fix(tui): revert kitty keyboard events workaround on windows (#20180)
parent
eaa272ef7f
commit
a4a9ea4ab0
|
|
@ -132,7 +132,7 @@ function rendererConfig(_config: TuiConfig.Info): CliRendererConfig {
|
||||||
targetFps: 60,
|
targetFps: 60,
|
||||||
gatherStats: false,
|
gatherStats: false,
|
||||||
exitOnCtrlC: false,
|
exitOnCtrlC: false,
|
||||||
useKittyKeyboard: { events: process.platform === "win32" },
|
useKittyKeyboard: {},
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
openConsoleOnError: false,
|
openConsoleOnError: false,
|
||||||
useMouse: mouseEnabled,
|
useMouse: mouseEnabled,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import { usePromptStash } from "./stash"
|
||||||
import { DialogStash } from "../dialog-stash"
|
import { DialogStash } from "../dialog-stash"
|
||||||
import { type AutocompleteRef, Autocomplete } from "./autocomplete"
|
import { type AutocompleteRef, Autocomplete } from "./autocomplete"
|
||||||
import { useCommandDialog } from "../dialog-command"
|
import { useCommandDialog } from "../dialog-command"
|
||||||
import { useKeyboard, useRenderer, type JSX } from "@opentui/solid"
|
import { useRenderer, type JSX } from "@opentui/solid"
|
||||||
import { Editor } from "@tui/util/editor"
|
import { Editor } from "@tui/util/editor"
|
||||||
import { useExit } from "../../context/exit"
|
import { useExit } from "../../context/exit"
|
||||||
import { Clipboard } from "../../util/clipboard"
|
import { Clipboard } from "../../util/clipboard"
|
||||||
|
|
@ -400,20 +400,6 @@ export function Prompt(props: PromptProps) {
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
// Windows Terminal 1.25+ handles Ctrl+V on keydown when kitty events are
|
|
||||||
// enabled, but still reports the kitty key-release event. Probe on release.
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
useKeyboard(
|
|
||||||
(evt) => {
|
|
||||||
if (!input.focused) return
|
|
||||||
if (evt.name === "v" && evt.ctrl && evt.eventType === "release") {
|
|
||||||
command.trigger("prompt.paste")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ release: true },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const ref: PromptRef = {
|
const ref: PromptRef = {
|
||||||
get focused() {
|
get focused() {
|
||||||
return input.focused
|
return input.focused
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue