From a454723727cea1b02b1ed4c472838ed8b1233d7e Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Sat, 23 Aug 2025 00:20:26 +0100 Subject: [PATCH] add apply cursor type make it focus the terminal when spawning fix step in the scrollback slider --- ShhShell/Views/Settings/SettingsView.swift | 2 +- ShhShell/Views/Terminal/SSHTerminalDelegate.swift | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ShhShell/Views/Settings/SettingsView.swift b/ShhShell/Views/Settings/SettingsView.swift index 4b040c5..1e03de3 100644 --- a/ShhShell/Views/Settings/SettingsView.swift +++ b/ShhShell/Views/Settings/SettingsView.swift @@ -27,7 +27,7 @@ struct SettingsView: View { Slider( value: $hostsManager.settings.scrollback, in: 100...10_000, - step: 1_000.0 + step: 100 ) } diff --git a/ShhShell/Views/Terminal/SSHTerminalDelegate.swift b/ShhShell/Views/Terminal/SSHTerminalDelegate.swift index 9a309bc..ee96ebb 100644 --- a/ShhShell/Views/Terminal/SSHTerminalDelegate.swift +++ b/ShhShell/Views/Terminal/SSHTerminalDelegate.swift @@ -30,7 +30,9 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina } applySelectedTheme() applyScrollbackLength() + applyCursorType() startFeedLoop() + self.becomeFirstResponder() } } @@ -69,6 +71,11 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina applyTheme(hostsManager.selectedTheme) } + func applyCursorType() { + guard let hostsManager else { return } + getTerminal().setCursorStyle(hostsManager.settings.cursorType.stCursorStyle) + } + func applyTheme(_ theme: Theme) { getTerminal().installPalette(colors: theme.ansi) getTerminal().foregroundColor = theme.foreground