ckampfe / russ

A TUI RSS reader with vim-like controls and a local-first, offline-first focus
GNU Affero General Public License v3.0
173 stars 18 forks source link

[Bug] Clipboard functionality expects `clip.exe` on Linux #6

Closed NickLarsenNZ closed 2 years ago

NickLarsenNZ commented 2 years ago

I think this is supposed to be #[cfg(target_os = "windows")].

https://github.com/ckampfe/russ/blob/abb911c57b9ba9deaaa288e5b10ce16ea43e2bd2/src/util.rs#L60-L69

It should also cater for Linux and Macos (and BSDs), although there is no standard clipboard util. Perhaps this could be configurable via env, or config file in $XDG_CONFIG_HOME/russ/?

ckampfe commented 2 years ago

Thanks for the report. Unfortunately I don't currently have a non-WSL Linux machine to try to reproduce myself. Did you experience this firsthand under non-WSL Linux?

The lone call to set_wsl_clipboard_contents in the app is behind a check of an is_wsl flag, so if this codepath is somehow running under regular, non-WSL Linux then it is definitely a bug.

It should also cater for Linux and Macos (and BSDs), although there is no standard clipboard util. Perhaps this could be configurable via env, or config file in $XDG_CONFIG_HOME/russ/?

In all cases other than WSL, the clipboard is handled by https://github.com/alacritty/copypasta, and so we're at the mercy of what they support. I use Russ daily on Macos (and sometimes on WSL - which is why this particular strange clip.exe functionality exists 😂 ) and whatever the alacritty clipboard lib does seems to work fine, although I may be misunderstanding your comments. Please correct me if so.

NickLarsenNZ commented 2 years ago

I haven't actually tried on Linux/WSL (I currently use a Mac). Makes sense that it uses clip.exe if it's in WLS

I guess I was just thrown off by WSL being a special case instead of treating it as Linux. I'll close the issue :)