mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
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:
@@ -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)
|
||||
|
||||
63
ShhShell/Views/Terminal/MiniTerminalDelegate.swift
Normal file
63
ShhShell/Views/Terminal/MiniTerminalDelegate.swift
Normal file
@@ -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