Skip to content

Commit

Permalink
update params
Browse files Browse the repository at this point in the history
  • Loading branch information
lithium0003 committed Apr 10, 2023
1 parent bbefc5d commit 4e9d2e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
4 changes: 2 additions & 2 deletions sshview.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_ASSET_PATHS = "\"sshview/Preview Content\"";
DEVELOPMENT_TEAM = 7A9X38B4YU;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -373,7 +373,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_ASSET_PATHS = "\"sshview/Preview Content\"";
DEVELOPMENT_TEAM = 7A9X38B4YU;
ENABLE_PREVIEWS = YES;
Expand Down
14 changes: 7 additions & 7 deletions sshview/SSHDaemon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ actor LocalPortForward {

var connSockfds: [Int32: ssh_channel] = [:]

static let buflen = 512 * 1024
static let buflen = 4 * 1024
var buffer = [UInt8](repeating: 0, count: buflen)

init?(session: ssh_session, localPort: UInt16, remoteHost: String, remotePort: UInt16) {
Expand Down Expand Up @@ -290,7 +290,7 @@ actor TerminalSession {

var channel: ssh_channel!

static let buflen = 512 * 1024
static let buflen = 4 * 1024
var buffer = [UInt8](repeating: 0, count: buflen)

init?(session: ssh_session, stdinFnc: (()->[UInt8]?)?, stdoutFnc: ((ArraySlice<UInt8>)->Void)?, stderrFnc: ((ArraySlice<UInt8>)->Void)?) async throws {
Expand Down Expand Up @@ -460,7 +460,7 @@ actor CommandSession {

var channel: ssh_channel!

static let buflen = 512 * 1024
static let buflen = 4 * 1024
var buffer = [UInt8](repeating: 0, count: buflen)

init? (session: ssh_session, comand: [UInt8], stdinFnc: (()->[UInt8]?)?, stdoutFnc: ((ArraySlice<UInt8>)->Void)?, stderrFnc: ((ArraySlice<UInt8>)->Void)?) async throws {
Expand Down Expand Up @@ -741,17 +741,17 @@ class SSHDaemon: ObservableObject {
}
let connection = Connections()

static let buflen = 512 * 1024
static let buflen = 4 * 1024
var buffer = [UInt8](repeating: 0, count: buflen)
var task = Task<Void, Never> {}

init() {
signal(SIGPIPE, handler)

task = Task {
task = Task.detached {
while true {
await processDataLoop()
try? await Task.sleep(nanoseconds: 1_000_000)
await self.processDataLoop()
try? await Task.sleep(nanoseconds: 50_000)
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions sshview/TerminalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,15 @@ class InvisibleTextView: UIView, UIKeyInput {
guard value >= 0x40, value <= 0x5F else {
return
}
print("^"+text)
let code = value & 0x1F
delegate?.insertCode(code: [code])
}
else {
print(text)
delegate?.insertText(text: text)
}
}

func deleteBackward() {
print("(delete)")
delegate?.deleteText()
}

Expand Down Expand Up @@ -298,7 +295,6 @@ class CanvasView: UIView {
}
let th = atan2(d.y, d.x)
let count = Int(length / 50.0) + 1
print(count, length, th)
if th >= -CGFloat.pi / 4, th < CGFloat.pi / 4 {
// right
if console.applicationCursor {
Expand Down Expand Up @@ -550,7 +546,6 @@ class consoleScreen: ObservableObject {
]
let s = NSAttributedString(string: " ", attributes: stringAttributes).boundingRect(with: UIScreen.main.bounds.size, context: nil)
let newSize = (width: Int(ceil(size.width) / floor(s.width)), height: Int(ceil(size.height) / floor(s.height)))
print(newSize)

for i in 0..<screenText.count {
if screenText[i].count < newSize.width {
Expand Down Expand Up @@ -933,7 +928,6 @@ class TerminalScreen: ObservableObject {
var escSequence: [UInt8] = []
var tmpBuf: [UInt8] = []

print(screenBuffer)
for c in screenBuffer {
if escSequence.count > 0 {
if c == 0x1B {
Expand All @@ -959,7 +953,6 @@ class TerminalScreen: ObservableObject {
continue
}

print(escSequence)
escSequence = []
continue
case 0x24:
Expand All @@ -986,7 +979,6 @@ class TerminalScreen: ObservableObject {
}
escSequence.append(c)

print(escSequence)
escSequence = []
continue
}
Expand Down Expand Up @@ -1165,7 +1157,6 @@ class TerminalScreen: ObservableObject {
let command = String(bytes: [endc], encoding: .utf8)!
let Pt = String(bytes: escSequence[2...].dropLast(), encoding: .utf8)!

print(Pt, command)
if command == "@" {
// ICH
// CSI Ps @
Expand Down Expand Up @@ -1759,7 +1750,6 @@ class TerminalScreen: ObservableObject {
if v.count == 2 {
let Ps = String(bytes: v[0], encoding: .utf8)!
let Pt = String(bytes: v[1], encoding: .utf8)!
print(Ps, Pt)
if Ps == "0" || Ps == "1" || Ps == "2" {
// window title
windowTitle = Pt
Expand Down Expand Up @@ -1854,7 +1844,6 @@ class TerminalScreen: ObservableObject {
}
screenBuffer = []
screen.drawView()
print(screen.curX, screen.curY)
}
}

0 comments on commit 4e9d2e4

Please sign in to comment.