mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 21:36:17 +00:00
hardcoded a wip jellycursor
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
import LibSSH
|
||||
import libssh2
|
||||
import OSLog
|
||||
import SwiftUI
|
||||
import SwiftTerm
|
||||
|
||||
@@ -52,9 +52,18 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
||||
}
|
||||
}
|
||||
|
||||
override func showCursor(source: Terminal) {
|
||||
super.showCursor(source: source)
|
||||
print("showcursor called")
|
||||
}
|
||||
|
||||
override func hideCursor(source: Terminal) {
|
||||
super.hideCursor(source: source)
|
||||
print("hide cursor called")
|
||||
}
|
||||
|
||||
override func cursorStyleChanged(source: Terminal, newStyle: CursorStyle) {
|
||||
super.cursorStyleChanged(source: source, newStyle: newStyle)
|
||||
|
||||
}
|
||||
|
||||
func startFeedLoop() {
|
||||
|
||||
@@ -148,10 +148,7 @@ Hostkey fingerprint is \(handler.getHostkey() ?? "nil")
|
||||
handler.writeToChannel(hostsManager.snippets.first(where: { $0.id == handler.host.startupSnippetID })?.content)
|
||||
}
|
||||
} label: {
|
||||
Label(
|
||||
handler.connected ? "Disconnect" : "Connect",
|
||||
systemImage: handler.connected ? "xmark.app.fill" : "power"
|
||||
)
|
||||
Label("Connect", systemImage: "power")
|
||||
}
|
||||
.disabled(handler.hostInvalid())
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ import AudioToolbox
|
||||
struct ShellView: View {
|
||||
@ObservedObject var handler: SSHHandler
|
||||
@ObservedObject var hostsManager: HostsManager
|
||||
|
||||
@ObservedObject var container = TerminalViewContainer.shared
|
||||
|
||||
@State var jellyLoc: (x: Int, y: Int) = (0, 0)
|
||||
@State var jellyShow: Bool = true
|
||||
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var body: some View {
|
||||
@@ -22,10 +24,31 @@ struct ShellView: View {
|
||||
hostsManager.selectedTheme.background.suiColor
|
||||
.ignoresSafeArea(.all)
|
||||
|
||||
ZStack {
|
||||
ZStack(alignment: .topLeading) {
|
||||
TerminalController(handler: handler, hostsManager: hostsManager)
|
||||
// .colorMultiply(Color(red: 0.95, green: 1, blue: 0.95, opacity: 1))
|
||||
.brightness(hostsManager.settings.filter == .crt ? 0.2 : 0.0)
|
||||
.onAppear {
|
||||
let timer = Timer(timeInterval: 0.1, repeats: true) { timer in
|
||||
DispatchQueue.main.async {
|
||||
let terminalView = container.sessions[handler.sessionID ?? UUID()]?.terminalView
|
||||
terminalView?.getTerminal().hideCursor()
|
||||
jellyLoc = terminalView?.getTerminal().getCursorLocation() ?? (0,0)
|
||||
jellyShow = terminalView?.getTerminal().buffer.isCursorInViewPort ?? true
|
||||
}
|
||||
}
|
||||
RunLoop.main.add(timer, forMode: .common)
|
||||
}
|
||||
|
||||
Rectangle()
|
||||
.frame(width: 4.3, height: 12)
|
||||
.offset(
|
||||
x: CGFloat(jellyLoc.x)*4.3,
|
||||
y: CGFloat(jellyLoc.y)*8.66
|
||||
)
|
||||
.opacity(jellyShow ? 1 : 0)
|
||||
.animation(.spring, value: jellyLoc.x)
|
||||
.animation(.spring, value: jellyLoc.y)
|
||||
|
||||
if hostsManager.settings.filter == .crt {
|
||||
CRTView()
|
||||
.opacity(0.75)
|
||||
|
||||
Reference in New Issue
Block a user