Support image drag-and-drop into SSH terminals (#1838)
* 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>
This commit is contained in:
parent
8286c90863
commit
4376e6e19a
11 changed files with 2469 additions and 74 deletions
38
Sources/RemoteRelayZshBootstrap.swift
Normal file
38
Sources/RemoteRelayZshBootstrap.swift
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
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\"",
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue