diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-06 02:27:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-06 02:27:06 +0300 |
| commit | 9e9bc8a144667a6b7debfd4f0c7a31ff0e11493a (patch) | |
| tree | 03f1259f91fd9edeacfd4b904f2e84d4acf25232 /src/client/clipboard_forwarding.rs | |
| parent | 35b0dff96579f099e0436290085024424ffb289c (diff) | |
feat: manage multiple ssh machines from one client (#3670)
Diffstat (limited to 'src/client/clipboard_forwarding.rs')
| -rw-r--r-- | src/client/clipboard_forwarding.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client/clipboard_forwarding.rs b/src/client/clipboard_forwarding.rs new file mode 100644 index 00000000..2de5f49f --- /dev/null +++ b/src/client/clipboard_forwarding.rs @@ -0,0 +1,16 @@ +use super::*; + +pub(super) fn decode_clipboard_payload(data: &str) -> Option<Vec<u8>> { + use base64::Engine; + + base64::engine::general_purpose::STANDARD.decode(data).ok() +} + +pub(super) fn forward_clipboard(data: &str) -> bool { + let Some(bytes) = decode_clipboard_payload(data) else { + warn!("received invalid clipboard payload from server"); + return false; + }; + crate::selection::write_osc52_bytes(&bytes); + true +} |
