feat(terminal): add word/line cursor shortcuts for shell line-editing
Intercept keyboard events via xterm's custom key handler and emit readline/zle escape sequences so bindings work regardless of terminfo: - Alt/Option + Left/Right: word-wise cursor move - Alt/Option + Backspace: delete previous word - macOS Cmd + Left/Right: jump to line start/end - macOS Cmd + Backspace: clear to line start Uses `e.code` to stay correct on dead-key layouts, skips IME composition, and excludes AltGr (ctrl+alt) on Windows/Linux.
This commit is contained in:
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react"
|
||||
|
||||
export type PlatformType = "macos" | "windows" | "linux" | "unknown"
|
||||
|
||||
function detectPlatform(): PlatformType {
|
||||
export function detectPlatform(): PlatformType {
|
||||
if (typeof navigator === "undefined") return "unknown"
|
||||
|
||||
const platform = navigator.platform.toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user