8000 Fix: Copying doesn't work via CLI nor TUI by jooaf · Pull Request #9 · jooaf/thoth · GitHub
[go: up one dir, main page]

Skip to content

Fix: Copying doesn't work via CLI nor TUI - #9

Closed
jooaf wants to merge 2 commits into
mainfrom
copy-fix-x11
Closed

jooaf wants to merge 2 commits into
mainfrom
copy-fix-x11

Conversation

@jooaf
@jooaf jooaf commented Sep 17, 2024
Copy link
Copy Markdown
Owner

This PR provides a fix for this issue. @alban-b mentioned that there were issues with copying from CLI using thoth copy and within the TUI. I added a fix based on this Stackoverflow page reference: https://stackoverflow.com/questions/73190617/weird-issue-with-copypasta-rust-crate-whilst-setting-clipboard-context-set-co

Testing

I built and ran the code in this PR on my linux machine (Linux 23.1.4 Manjaro Linux) using Alacritty and Wezterm. I also verified that I am running X11 on my machine via running ls /tmp/.X11-unix/. It appears that everything is working on my machine but I will check to see if this works on Arch Linux.

@fmotalleb
Copy link
Copy Markdown
Contributor

Hi, I randomly came across this and faced the same issue once. It's not directly related to Arch Linux, but rather depends on the desktop environment (DE) you're using. For example, when you're using GNOME, it handles your clipboard, so it works regardless of whether you're using X11 or Wayland. However, in some other DEs, especially minimal ones, there may not be a clipboard management mechanism. In those cases, the process that attempts to set clipboard data doesn't directly set it, but instead holds the data and only provides it when the user accesses the clipboard.

So if you see my clipboard plugin I've added a feature for daemon mode, it spawns another process (as a subprocess to nushell) and serves as a daemon that provides clipboard content

@alban-b
alban-b commented Sep 18, 2024
Copy link
Copy Markdown

@fmotalleb A big thanks for your input, As it still doesn't work on my side with this PR fix, I was going to embark on more extensive and time-consuming research.

I'm actually using XFCE, which is more minimal than Gnome, so I'll see what additional programs I can install to compensate for this problem and let you know @jooaf

@jooaf
jooaf commented Sep 18, 2024
Copy link
Copy Markdown
Owner Author

@fmotalleb Thank you so much for the feedback! This helps a lot. I'll go ahead and implement something similar to what you've done with the nushell clipboard plugin and do some further digging. @alban-b sure sounds good, thanks so much for your patience and I'm sorry things aren't working. For what it's worth, I tested using XFCE as my desktop environment and it worked.

Copy link
Copy Markdown
Contributor

Hi! @alban-b can you try https://github.com/FMotalleb/thoth?

@alban-b
alban-b commented Sep 18, 2024
Copy link
Copy Markdown

@fmotalleb
Hi, I tried the changes on your PR without installing anything more : copy work perfectly from TUI but don't work from CLI (but it doesn't empty current clipboard)

@jooaf Please, don't be sorry. You freely share some valuable work that should be of use to others, and you're responsive when things go wrong. I can't really ask for much more :)

@jooaf
jooaf commented Sep 19, 2024
Copy link
Copy Markdown
Owner Author

@alban-b could you try this when you get the chance: #11 ? This builds on top of @fmotalleb work.

@jooaf jooaf closed this Sep 20, 2024
@jooaf
jooaf deleted the copy-fix-x11 branch January 2, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0