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:
Lawrence Chen 2026-03-20 18:31:19 -07:00 committed by GitHub
parent 8286c90863
commit 4376e6e19a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 2469 additions and 74 deletions

View 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\"",
]
}
}