mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
remove overlay jelly cursor implementation, check jelly branch on https://github.com/neon443/SwiftTerm
add empty handler for 133 iterm2
This commit is contained in:
@@ -83,6 +83,9 @@
|
|||||||
A9921DE12E5F5710009F72A8 /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9921DE02E5F5710009F72A8 /* WelcomeView.swift */; };
|
A9921DE12E5F5710009F72A8 /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9921DE02E5F5710009F72A8 /* WelcomeView.swift */; };
|
||||||
A9921FFF2E61D537009F72A8 /* libssh2.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9921FFE2E61D537009F72A8 /* libssh2.xcframework */; };
|
A9921FFF2E61D537009F72A8 /* libssh2.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9921FFE2E61D537009F72A8 /* libssh2.xcframework */; };
|
||||||
A994D64A2E5C94E200672395 /* ShaderTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A994D6492E5C94E200672395 /* ShaderTestingView.swift */; };
|
A994D64A2E5C94E200672395 /* ShaderTestingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A994D6492E5C94E200672395 /* ShaderTestingView.swift */; };
|
||||||
|
A99D9F7B2E63513E00259166 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A99D9F7A2E63513E00259166 /* SwiftTerm */; };
|
||||||
|
A99D9F7E2E6351D100259166 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A99D9F7D2E6351D100259166 /* SwiftTerm */; };
|
||||||
|
A99D9F812E64F45B00259166 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A99D9F802E64F45B00259166 /* SwiftTerm */; };
|
||||||
A9A2F4F62E3001D300D0AE9B /* AddSnippetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A2F4F52E3001D300D0AE9B /* AddSnippetView.swift */; };
|
A9A2F4F62E3001D300D0AE9B /* AddSnippetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A2F4F52E3001D300D0AE9B /* AddSnippetView.swift */; };
|
||||||
A9B1E5852E5F8E86009309E5 /* WelcomeChunk.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E5842E5F8E86009309E5 /* WelcomeChunk.swift */; };
|
A9B1E5852E5F8E86009309E5 /* WelcomeChunk.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B1E5842E5F8E86009309E5 /* WelcomeChunk.swift */; };
|
||||||
A9BA1D192E1D9AE1005BDCEF /* SwiftTerm.Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BA1D182E1D9AE1005BDCEF /* SwiftTerm.Color.swift */; };
|
A9BA1D192E1D9AE1005BDCEF /* SwiftTerm.Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BA1D182E1D9AE1005BDCEF /* SwiftTerm.Color.swift */; };
|
||||||
@@ -100,7 +103,6 @@
|
|||||||
A9D819312E102D8700442D38 /* HostkeysView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D819302E102D8700442D38 /* HostkeysView.swift */; };
|
A9D819312E102D8700442D38 /* HostkeysView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D819302E102D8700442D38 /* HostkeysView.swift */; };
|
||||||
A9DA97712E0D30ED00142DDC /* HostSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DA97702E0D30ED00142DDC /* HostSymbol.swift */; };
|
A9DA97712E0D30ED00142DDC /* HostSymbol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DA97702E0D30ED00142DDC /* HostSymbol.swift */; };
|
||||||
A9DA97732E0D40C100142DDC /* HostSymbolPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DA97722E0D40C100142DDC /* HostSymbolPreview.swift */; };
|
A9DA97732E0D40C100142DDC /* HostSymbolPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DA97722E0D40C100142DDC /* HostSymbolPreview.swift */; };
|
||||||
A9E78F422E58BD770079F3CC /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A9E78F412E58BD770079F3CC /* SwiftTerm */; };
|
|
||||||
A9FD37552E143D23005319A8 /* SecKeyConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FD37542E143D23005319A8 /* SecKeyConvertible.swift */; };
|
A9FD37552E143D23005319A8 /* SecKeyConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FD37542E143D23005319A8 /* SecKeyConvertible.swift */; };
|
||||||
A9FD37572E143D5A005319A8 /* SecKeyStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FD37562E143D5A005319A8 /* SecKeyStore.swift */; };
|
A9FD37572E143D5A005319A8 /* SecKeyStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FD37562E143D5A005319A8 /* SecKeyStore.swift */; };
|
||||||
A9FD37592E143D74005319A8 /* GenericPasswordConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FD37582E143D74005319A8 /* GenericPasswordConvertible.swift */; };
|
A9FD37592E143D74005319A8 /* GenericPasswordConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FD37582E143D74005319A8 /* GenericPasswordConvertible.swift */; };
|
||||||
@@ -260,11 +262,13 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
A99D9F7E2E6351D100259166 /* SwiftTerm in Frameworks */,
|
||||||
|
A99D9F7B2E63513E00259166 /* SwiftTerm in Frameworks */,
|
||||||
A95FAA542DF4B62900DE2F5A /* LibSSH.xcframework in Frameworks */,
|
A95FAA542DF4B62900DE2F5A /* LibSSH.xcframework in Frameworks */,
|
||||||
A9E78F422E58BD770079F3CC /* SwiftTerm in Frameworks */,
|
|
||||||
A93143BE2DF4D0B300FCD5DB /* libpthread.tbd in Frameworks */,
|
A93143BE2DF4D0B300FCD5DB /* libpthread.tbd in Frameworks */,
|
||||||
A9921FFF2E61D537009F72A8 /* libssh2.xcframework in Frameworks */,
|
A9921FFF2E61D537009F72A8 /* libssh2.xcframework in Frameworks */,
|
||||||
A9083E402DF2226F0042906E /* libz.tbd in Frameworks */,
|
A9083E402DF2226F0042906E /* libz.tbd in Frameworks */,
|
||||||
|
A99D9F812E64F45B00259166 /* SwiftTerm in Frameworks */,
|
||||||
A95FAA562DF4B62A00DE2F5A /* openssl.xcframework in Frameworks */,
|
A95FAA562DF4B62A00DE2F5A /* openssl.xcframework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@@ -698,7 +702,9 @@
|
|||||||
);
|
);
|
||||||
name = ShhShell;
|
name = ShhShell;
|
||||||
packageProductDependencies = (
|
packageProductDependencies = (
|
||||||
A9E78F412E58BD770079F3CC /* SwiftTerm */,
|
A99D9F7A2E63513E00259166 /* SwiftTerm */,
|
||||||
|
A99D9F7D2E6351D100259166 /* SwiftTerm */,
|
||||||
|
A99D9F802E64F45B00259166 /* SwiftTerm */,
|
||||||
);
|
);
|
||||||
productName = ShhShell;
|
productName = ShhShell;
|
||||||
productReference = A925389A2DEE06DC007E0A18 /* ShhShell.app */;
|
productReference = A925389A2DEE06DC007E0A18 /* ShhShell.app */;
|
||||||
@@ -778,7 +784,7 @@
|
|||||||
mainGroup = A92538912DEE06DC007E0A18;
|
mainGroup = A92538912DEE06DC007E0A18;
|
||||||
minimizedProjectReferenceProxies = 1;
|
minimizedProjectReferenceProxies = 1;
|
||||||
packageReferences = (
|
packageReferences = (
|
||||||
A9E78F402E58BD770079F3CC /* XCRemoteSwiftPackageReference "SwiftTerm" */,
|
A99D9F7F2E64F45B00259166 /* XCRemoteSwiftPackageReference "SwiftTerm" */,
|
||||||
);
|
);
|
||||||
productRefGroup = A925389B2DEE06DC007E0A18 /* Products */;
|
productRefGroup = A925389B2DEE06DC007E0A18 /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
@@ -1273,20 +1279,28 @@
|
|||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
/* Begin XCRemoteSwiftPackageReference section */
|
/* Begin XCRemoteSwiftPackageReference section */
|
||||||
A9E78F402E58BD770079F3CC /* XCRemoteSwiftPackageReference "SwiftTerm" */ = {
|
A99D9F7F2E64F45B00259166 /* XCRemoteSwiftPackageReference "SwiftTerm" */ = {
|
||||||
isa = XCRemoteSwiftPackageReference;
|
isa = XCRemoteSwiftPackageReference;
|
||||||
repositoryURL = "https://github.com/migueldeicaza/SwiftTerm";
|
repositoryURL = "https://github.com/neon443/SwiftTerm";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = revision;
|
branch = jelly;
|
||||||
revision = b48ebbbffee544df3f5dc8f43258f44f95d75c6f;
|
kind = branch;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/* End XCRemoteSwiftPackageReference section */
|
/* End XCRemoteSwiftPackageReference section */
|
||||||
|
|
||||||
/* Begin XCSwiftPackageProductDependency section */
|
/* Begin XCSwiftPackageProductDependency section */
|
||||||
A9E78F412E58BD770079F3CC /* SwiftTerm */ = {
|
A99D9F7A2E63513E00259166 /* SwiftTerm */ = {
|
||||||
isa = XCSwiftPackageProductDependency;
|
isa = XCSwiftPackageProductDependency;
|
||||||
package = A9E78F402E58BD770079F3CC /* XCRemoteSwiftPackageReference "SwiftTerm" */;
|
productName = SwiftTerm;
|
||||||
|
};
|
||||||
|
A99D9F7D2E6351D100259166 /* SwiftTerm */ = {
|
||||||
|
isa = XCSwiftPackageProductDependency;
|
||||||
|
productName = SwiftTerm;
|
||||||
|
};
|
||||||
|
A99D9F802E64F45B00259166 /* SwiftTerm */ = {
|
||||||
|
isa = XCSwiftPackageProductDependency;
|
||||||
|
package = A99D9F7F2E64F45B00259166 /* XCRemoteSwiftPackageReference "SwiftTerm" */;
|
||||||
productName = SwiftTerm;
|
productName = SwiftTerm;
|
||||||
};
|
};
|
||||||
/* End XCSwiftPackageProductDependency section */
|
/* End XCSwiftPackageProductDependency section */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"originHash" : "4d9d9af82f23f3c708bdd502fed3939413b4f2a95a79ae568364cc92bca1527e",
|
"originHash" : "702d8e7b18adc80c84aa168885ba00fbb7440c6e9f59acbbf93da8a625ebf380",
|
||||||
"pins" : [
|
"pins" : [
|
||||||
{
|
{
|
||||||
"identity" : "swift-argument-parser",
|
"identity" : "swift-argument-parser",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"location" : "https://github.com/swiftlang/swift-subprocess",
|
"location" : "https://github.com/swiftlang/swift-subprocess",
|
||||||
"state" : {
|
"state" : {
|
||||||
"branch" : "main",
|
"branch" : "main",
|
||||||
"revision" : "7dc6e548114db7d6b10fddf29bcd5215c3875891"
|
"revision" : "f0ba4f43931c4e0f6d15078421dee7cb1415ce5d"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -31,9 +31,10 @@
|
|||||||
{
|
{
|
||||||
"identity" : "swiftterm",
|
"identity" : "swiftterm",
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/migueldeicaza/SwiftTerm",
|
"location" : "https://github.com/neon443/SwiftTerm",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "b48ebbbffee544df3f5dc8f43258f44f95d75c6f"
|
"branch" : "jelly",
|
||||||
|
"revision" : "a3eda5e08f019ce2b6f21b03e1e1e71e75ee0591"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
applySelectedTheme()
|
applySelectedTheme()
|
||||||
applyScrollbackLength()
|
applyScrollbackLength()
|
||||||
applyCursorType()
|
applyCursorType()
|
||||||
|
getTerminal().registerOscHandler(code: 133, handler: { _ in })
|
||||||
// DispatchQueue.main.asyncAfter(deadline: .now()+0.01) {
|
// DispatchQueue.main.asyncAfter(deadline: .now()+0.01) {
|
||||||
self.startFeedLoop()
|
self.startFeedLoop()
|
||||||
let _ = self.becomeFirstResponder()
|
let _ = self.becomeFirstResponder()
|
||||||
|
|||||||
@@ -13,8 +13,34 @@ struct ShellView: View {
|
|||||||
@ObservedObject var hostsManager: HostsManager
|
@ObservedObject var hostsManager: HostsManager
|
||||||
@ObservedObject var container = TerminalViewContainer.shared
|
@ObservedObject var container = TerminalViewContainer.shared
|
||||||
|
|
||||||
@State var jellyLoc: (x: Int, y: Int) = (0, 0)
|
@State var cursorPos: (x: Int, y: Int) = (0, 0)
|
||||||
@State var jellySize: CGSize = CGSize(width: 0, height: 0)
|
var jellyLoc: CGSize {
|
||||||
|
var offset = CGSize(width: cursorPos.x, height: cursorPos.y)
|
||||||
|
offset.width *= cellDimension.width
|
||||||
|
offset.height *= cellDimension.height
|
||||||
|
switch hostsManager.settings.cursorType.cursorShape {
|
||||||
|
case .block, .bar:
|
||||||
|
fallthrough
|
||||||
|
case .underline:
|
||||||
|
offset.height += cellDimension.height * 0.8
|
||||||
|
}
|
||||||
|
return offset
|
||||||
|
}
|
||||||
|
|
||||||
|
@State var cellDimension: CGSize = CGSize(width: 0, height: 0)
|
||||||
|
var jellySize: CGSize {
|
||||||
|
var cellDimension: CGSize = cellDimension
|
||||||
|
switch hostsManager.settings.cursorType.cursorShape {
|
||||||
|
case .block:
|
||||||
|
fallthrough
|
||||||
|
case .bar:
|
||||||
|
cellDimension.width *= 0.3
|
||||||
|
case .underline:
|
||||||
|
cellDimension.height *= 0.2
|
||||||
|
}
|
||||||
|
return cellDimension
|
||||||
|
}
|
||||||
|
|
||||||
@State var jellyShow: Bool = true
|
@State var jellyShow: Bool = true
|
||||||
|
|
||||||
@Environment(\.dismiss) var dismiss
|
@Environment(\.dismiss) var dismiss
|
||||||
@@ -34,23 +60,27 @@ struct ShellView: View {
|
|||||||
let terminalView = container.sessions[handler.sessionID ?? UUID()]?.terminalView
|
let terminalView = container.sessions[handler.sessionID ?? UUID()]?.terminalView
|
||||||
let delegate = terminalView?.terminalDelegate as? SSHTerminalDelegate
|
let delegate = terminalView?.terminalDelegate as? SSHTerminalDelegate
|
||||||
terminalView?.getTerminal().hideCursor()
|
terminalView?.getTerminal().hideCursor()
|
||||||
jellyLoc = terminalView?.getTerminal().getCursorLocation() ?? jellyLoc
|
cursorPos = terminalView?.getTerminal().getCursorLocation() ?? cursorPos
|
||||||
jellySize = delegate?.computeFontDimensions() ?? jellySize
|
cellDimension = delegate?.computeFontDimensions() ?? cellDimension
|
||||||
// jellyShow = terminalView?.getTerminal().buffer.isCursorInViewPort ?? jellyShow
|
// jellyShow = terminalView?.getTerminal().buffer.isCursorInViewPort ?? jellyShow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RunLoop.main.add(timer, forMode: .common)
|
// RunLoop.main.add(timer, forMode: .common)
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle()
|
// Rectangle()
|
||||||
.frame(width: jellySize.width, height: jellySize.height)
|
// .frame(width: jellySize.width, height: jellySize.height)
|
||||||
.offset(
|
// .offset(
|
||||||
x: CGFloat(jellyLoc.x)*jellySize.width,
|
// x: jellyLoc.width,
|
||||||
y: CGFloat(jellyLoc.y)*jellySize.height
|
// y: jellyLoc.height
|
||||||
)
|
// )
|
||||||
.opacity(jellyShow ? 1 : 0)
|
// .opacity(jellyShow ? 1 : 0)
|
||||||
.animation(.spring, value: jellyLoc.x)
|
// .animation(.spring(duration: 0.2, bounce: 0.6), value: cursorPos.x)
|
||||||
.animation(.spring, value: jellyLoc.y)
|
// .animation(.spring(duration: 0.2, bounce: 0.6), value: cursorPos.y)
|
||||||
|
// .animation(.spring(duration: 0.2, bounce: 0.6), value: jellyLoc.width)
|
||||||
|
// .animation(.spring(duration: 0.2, bounce: 0.6), value: jellyLoc.height)
|
||||||
|
// .animation(.spring(duration: 0.2, bounce: 0.6), value: jellySize.width)
|
||||||
|
// .animation(.spring(duration: 0.2, bounce: 0.6), value: jellySize.height)
|
||||||
|
|
||||||
if hostsManager.settings.filter == .crt {
|
if hostsManager.settings.filter == .crt {
|
||||||
CRTView()
|
CRTView()
|
||||||
|
|||||||
Reference in New Issue
Block a user