* Add remote image drag-and-drop uploads * test: cover ssh image paste planning * fix: upload images pasted into ssh terminals * fix: share zsh history in cmux ssh relay shells * fix: add cancellable ssh image transfer indicator * fix: harden async ssh image transfer callbacks * fix: address ssh image upload review feedback --------- Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
38 lines
1.2 KiB
Swift
38 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
struct RemoteRelayZshBootstrap {
|
|
let shellStateDir: String
|
|
|
|
private var sharedHistoryLines: [String] {
|
|
[
|
|
"if [ -z \"${HISTFILE:-}\" ] || [ \"$HISTFILE\" = \"\(shellStateDir)/.zsh_history\" ]; then export HISTFILE=\"$CMUX_REAL_ZDOTDIR/.zsh_history\"; fi",
|
|
]
|
|
}
|
|
|
|
var zshEnvLines: [String] {
|
|
[
|
|
"[ -f \"$CMUX_REAL_ZDOTDIR/.zshenv\" ] && source \"$CMUX_REAL_ZDOTDIR/.zshenv\"",
|
|
"if [ -n \"${ZDOTDIR:-}\" ] && [ \"$ZDOTDIR\" != \"\(shellStateDir)\" ]; then export CMUX_REAL_ZDOTDIR=\"$ZDOTDIR\"; fi",
|
|
] + sharedHistoryLines + [
|
|
"export ZDOTDIR=\"\(shellStateDir)\"",
|
|
]
|
|
}
|
|
|
|
var zshProfileLines: [String] {
|
|
[
|
|
"[ -f \"$CMUX_REAL_ZDOTDIR/.zprofile\" ] && source \"$CMUX_REAL_ZDOTDIR/.zprofile\"",
|
|
]
|
|
}
|
|
|
|
func zshRCLines(commonShellLines: [String]) -> [String] {
|
|
sharedHistoryLines + [
|
|
"[ -f \"$CMUX_REAL_ZDOTDIR/.zshrc\" ] && source \"$CMUX_REAL_ZDOTDIR/.zshrc\"",
|
|
] + commonShellLines
|
|
}
|
|
|
|
var zshLoginLines: [String] {
|
|
[
|
|
"[ -f \"$CMUX_REAL_ZDOTDIR/.zlogin\" ] && source \"$CMUX_REAL_ZDOTDIR/.zlogin\"",
|
|
]
|
|
}
|
|
}
|