chore: move terminal disconnection messages to i18n (#168)

This commit is contained in:
Mystery0 M
2025-02-08 09:15:21 +08:00
committed by GitHub
parent ca6cc68fed
commit 91e2e964a5
4 changed files with 13 additions and 2 deletions

View File

@@ -126,9 +126,14 @@ class SSHTerminalTab(windowScope: WindowScope, host: Host) :
override fun channelClosed(channel: Channel, reason: Throwable?) {
coroutineScope.launch(Dispatchers.Swing) {
terminal.write("\r\n\r\n${ControlCharacters.ESC}[31m")
terminal.write("Channel has been disconnected.")
terminal.write(I18n.getString("termora.terminal.channel-disconnected"))
if (reconnectShortcut is KeyShortcut) {
terminal.write(" Type $reconnectShortcut to reconnect.")
terminal.write(
I18n.getString(
"termora.terminal.channel-reconnect",
reconnectShortcut.toString()
)
)
}
terminal.write("\r\n")
terminal.write("${ControlCharacters.ESC}[0m")