mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-09 03:18:18 +00:00
refac
This commit is contained in:
parent
afa0609ece
commit
dbd0d7d742
1 changed files with 6 additions and 0 deletions
|
|
@ -105,6 +105,8 @@
|
|||
}
|
||||
connected = true;
|
||||
connecting = false;
|
||||
// Focus the terminal so it receives keyboard input immediately
|
||||
term?.focus();
|
||||
// Send initial resize
|
||||
if (term && ws) {
|
||||
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
|
||||
term.onResize(({ cols, rows }) => {
|
||||
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue