working on a miniterminalview :yay:

for stuff like static previews of how shit should look
 - eg cursor style previews
 - terminal effect shader previews
This commit is contained in:
neon443 committed 2025-08-23 17:14:28 +01:00
1 parent a5563731f0
commit 7b4da73ffa
4 files changed
+75 -2

No files matched your search

@@ -6,6 +6,7 @@
//
import SwiftUI
import SwiftTerm
struct SettingsView: View {
@ObservedObject var hostsManager: HostsManager
@@ -37,6 +38,9 @@ struct SettingsView: View {
}
.pickerStyle(.segmented)
ForEach(CursorShape.allCases, id: \.self) { type in
}
Picker("Cursor", selection: $hostsManager.settings.cursorType.cursorShape) {
ForEach(CursorShape.allCases, id: \.self) { type in
Text(type.description).tag(type)
@@ -0,0 +1,63 @@
//
// MiniTerminalDelegate.swift
// ShhShell
//
// Created by neon443 on 23/08/2025.
//
import Foundation
import UIKit
import SwiftUI
import SwiftTerm
@MainActor
class MiniTerminalDelegate: TerminalView, TerminalViewDelegate {
nonisolated public func sizeChanged(source: TerminalView, newCols: Int, newRows: Int) {
<#code#>
}
nonisolated public func setTerminalTitle(source: TerminalView, title: String) {
<#code#>
}
nonisolated public func hostCurrentDirectoryUpdate(source: TerminalView, directory: String?) {
<#code#>
}
nonisolated public func send(source: TerminalView, data: ArraySlice<UInt8>) {
<#code#>
}
nonisolated public func scrolled(source: TerminalView, position: Double) {
<#code#>
}
nonisolated public func requestOpenLink(source: SwiftTerm.TerminalView, link: String, params: [String : String]) {
<#code#>
}
nonisolated public func bell(source: TerminalView) {
<#code#>
}
nonisolated public func clipboardCopy(source: SwiftTerm.TerminalView, content: Data) {
<#code#>
}
nonisolated public func iTermContent (source: TerminalView, content: ArraySlice<UInt8>) {
<#code#>
}
nonisolated public func rangeChanged(source: SwiftTerm.TerminalView, startY: Int, endY: Int) {
<#code#>
}
public convenience required override init(frame: CGRect) {
self.init(frame: .zero)
}
public convenience required init?(coder: NSCoder) {
fatalError("unimplememented")
}
}
@@ -31,8 +31,10 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
applySelectedTheme()
applyScrollbackLength()
applyCursorType()
startFeedLoop()
self.becomeFirstResponder()
// DispatchQueue.main.asyncAfter(deadline: .now()+0.01) {
self.startFeedLoop()
let _ = self.becomeFirstResponder()
// }
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.