diff --git a/src/backend/ssh/terminal.ts b/src/backend/ssh/terminal.ts index 0f0b7a0b..7706fe13 100644 --- a/src/backend/ssh/terminal.ts +++ b/src/backend/ssh/terminal.ts @@ -427,18 +427,7 @@ wss.on("connection", async (ws: WebSocket, req) => { sshStream = stream; stream.on("data", (data: Buffer) => { - let decoded = data.toString("utf-8"); - - // Defensive fallback: if UTF-8 decode produces replacement characters - // and buffer contains high bytes, try latin1 (for legacy servers without UTF-8 locale) - if ( - decoded.includes("\uFFFD") && - data.some((byte) => byte >= 0x80 && byte <= 0xff) - ) { - decoded = data.toString("latin1"); - } - - ws.send(JSON.stringify({ type: "data", data: decoded })); + ws.send(JSON.stringify({ type: "data", data: data.toString("utf-8") })); }); stream.on("close", () => { diff --git a/src/ui/Desktop/Apps/Terminal/Terminal.tsx b/src/ui/Desktop/Apps/Terminal/Terminal.tsx index 5a686ec5..17a7edeb 100644 --- a/src/ui/Desktop/Apps/Terminal/Terminal.tsx +++ b/src/ui/Desktop/Apps/Terminal/Terminal.tsx @@ -532,6 +532,10 @@ export const Terminal = forwardRef(function SSHTerminal( terminal.loadAddon(clipboardAddon); terminal.loadAddon(unicode11Addon); terminal.loadAddon(webLinksAddon); + + // Activate Unicode 11 for proper emoji rendering (prevents double-width artifacts) + terminal.unicode.activeVersion = "11"; + terminal.open(xtermRef.current); const element = xtermRef.current; diff --git a/src/ui/Mobile/Apps/Terminal/Terminal.tsx b/src/ui/Mobile/Apps/Terminal/Terminal.tsx index c2470658..7428e628 100644 --- a/src/ui/Mobile/Apps/Terminal/Terminal.tsx +++ b/src/ui/Mobile/Apps/Terminal/Terminal.tsx @@ -233,6 +233,10 @@ export const Terminal = forwardRef(function SSHTerminal( terminal.loadAddon(clipboardAddon); terminal.loadAddon(unicode11Addon); terminal.loadAddon(webLinksAddon); + + // Activate Unicode 11 for proper emoji rendering (prevents double-width artifacts) + terminal.unicode.activeVersion = "11"; + terminal.open(xtermRef.current); const textarea = xtermRef.current.querySelector(