diff --git a/src/ui/Desktop/Apps/Terminal/Terminal.tsx b/src/ui/Desktop/Apps/Terminal/Terminal.tsx index 7367ff6f..1a53502e 100644 --- a/src/ui/Desktop/Apps/Terminal/Terminal.tsx +++ b/src/ui/Desktop/Apps/Terminal/Terminal.tsx @@ -99,7 +99,9 @@ export const Terminal = forwardRef(function SSHTerminal( if (terminal && typeof (terminal as any).refresh === "function") { (terminal as any).refresh(0, terminal.rows - 1); } - } catch (_) {} + } catch { + // Ignore terminal refresh errors + } } function scheduleNotify(cols: number, rows: number) { @@ -161,7 +163,9 @@ export const Terminal = forwardRef(function SSHTerminal( scheduleNotify(cols, rows); hardRefresh(); } - } catch (_) {} + } catch { + // Ignore resize notification errors + } }, refresh: () => hardRefresh(), }), @@ -480,7 +484,9 @@ export const Terminal = forwardRef(function SSHTerminal( await navigator.clipboard.writeText(text); return; } - } catch (_) {} + } catch { + // Clipboard API not available, fallback to textarea method + } const textarea = document.createElement("textarea"); textarea.value = text; textarea.style.position = "fixed"; @@ -500,7 +506,9 @@ export const Terminal = forwardRef(function SSHTerminal( if (navigator.clipboard && navigator.clipboard.readText) { return await navigator.clipboard.readText(); } - } catch (_) {} + } catch { + // Clipboard read not available or not permitted + } return ""; } @@ -560,7 +568,9 @@ export const Terminal = forwardRef(function SSHTerminal( const pasteText = await readTextFromClipboard(); if (pasteText) terminal.paste(pasteText); } - } catch (_) {} + } catch { + // Ignore clipboard operation errors + } }; element?.addEventListener("contextmenu", handleContextMenu); diff --git a/src/ui/Mobile/Apps/Terminal/Terminal.tsx b/src/ui/Mobile/Apps/Terminal/Terminal.tsx index ac164b98..4a442686 100644 --- a/src/ui/Mobile/Apps/Terminal/Terminal.tsx +++ b/src/ui/Mobile/Apps/Terminal/Terminal.tsx @@ -73,7 +73,9 @@ export const Terminal = forwardRef(function SSHTerminal( if (terminal && typeof (terminal as any).refresh === "function") { (terminal as any).refresh(0, terminal.rows - 1); } - } catch (_) {} + } catch { + // Ignore terminal refresh errors + } } function scheduleNotify(cols: number, rows: number) { @@ -122,7 +124,9 @@ export const Terminal = forwardRef(function SSHTerminal( scheduleNotify(cols, rows); hardRefresh(); } - } catch (_) {} + } catch { + // Ignore resize notification errors + } }, refresh: () => hardRefresh(), }), @@ -175,7 +179,9 @@ export const Terminal = forwardRef(function SSHTerminal( `\r\n[${msg.message || t("terminal.disconnected")}]`, ); } - } catch (error) {} + } catch { + // Ignore message parsing errors + } }); ws.addEventListener("close", (event) => {