refac
This commit is contained in:
@@ -105,6 +105,8 @@
|
|||||||
}
|
}
|
||||||
connected = true;
|
connected = true;
|
||||||
connecting = false;
|
connecting = false;
|
||||||
|
// Focus the terminal so it receives keyboard input immediately
|
||||||
|
term?.focus();
|
||||||
// Send initial resize
|
// Send initial resize
|
||||||
if (term && ws) {
|
if (term && ws) {
|
||||||
ws.send(JSON.stringify({ type: 'resize', cols: term.cols, rows: term.rows }));
|
ws.send(JSON.stringify({ type: 'resize', cols: term.cols, rows: term.rows }));
|
||||||
@@ -226,6 +228,10 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Ensure all key events are processed by xterm.js and not intercepted
|
||||||
|
// by the browser or surrounding UI (fixes vi/vim keystroke handling).
|
||||||
|
term.attachCustomKeyEventHandler(() => true);
|
||||||
|
|
||||||
// Handle resize
|
// Handle resize
|
||||||
term.onResize(({ cols, rows }) => {
|
term.onResize(({ cols, rows }) => {
|
||||||
if (ws && ws.readyState === WebSocket.OPEN) {
|
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||||
|
|||||||
Reference in New Issue
Block a user