8000 Block copy does not work · Issue #8 · jooaf/thoth · GitHub
[go: up one dir, main page]

Skip to content

Block copy does not work #8

Closed
Closed

Description

@alban-b

Hello,

I am currently using version 1.60 installed with cargo (installation on Archlinux with AUR results in an error when running thoth), but I am unable to copy a block or selection, either in main mode, edit mode or in CLI.

Any copy action from thoth just empties the system's clipboard.

I currently manage like this:

thoth view block_name | xsel --clipboard

but it's not very practical.

Any idea where the problem might be coming from? Let me know if you need more information.

I really like the way thoth works and would like to be able to use it in its entirety.

Thanks

  • OS: Archlinux
  • Terminal: wezterm 20240203-110809-5046fc22

Activity

  1. jooaf commented on Sep 17, 2024

    @jooaf
    Owner

    Hi there! Sorry that you're running into this issue :/ . Just so that I have a better understanding on what is going on, are you using X11 or Wayland as your window system? Or do you not have the display set? Just trying to get a better idea to understand the issue.

  2. alban-b commented on Sep 17, 2024

    @alban-b
    Author

    Don't worry, the project seems young but promising, I'm happy to be able to help a little bit stabilize it .

    I'm using X11 at the moment

  3. jooaf commented on Sep 17, 2024

    @jooaf
    Owner

    Thanks I appreciate it! Ok cool, I'm investigating. Seems there might be a bug with copypasta with X11, but i'm double checking

  4. jooaf commented on Sep 17, 2024

    @jooaf
    Owner

    ^ I have a PR for this out. I was able to get it working on my machine, although i will say I run Manjaro rather than Arch Linux directly. Let me know if this fixes the issue or not since I can't fully test the solution via Arch

  5. jooaf commented on Sep 20, 2024

    @jooaf
    Owner

    I just made a release with the clipboard fix. When you get the chance @alban-b could you let me know if it works on your end?

  6. alban-b commented on Sep 20, 2024

    @alban-b
    Author

    Just installed via Cargo and working perfectly, thank you!

  7. jooaf commented on Sep 20, 2024

    @jooaf
    Owner

    Excellent glad to hear! Thanks so much for reporting the bug :)

  8. alban-b commented on Sep 20, 2024

    @alban-b
    Author

    I've been wanting to learn rust for years, and I finally started this week after digging through the sources of your project during the bug report (any good resources for an experimented developer eager to learn is welcome 😁).

    Hope to contribute one day!

  9. jooaf commented on Sep 21, 2024

    @jooaf
    Owner

    Awesome! I'm still very new to Rust as well as this is my first major Rust project haha. I can describe the way that I've been going about learning:

    1. Went through the Rust Book (I'm sure you've heard of it). Apparently there is an interactive version of the book that came out: https://rust-book.cs.brown.edu/experiment-intro.html
    2. Went through Rustlings: https://github.com/rust-lang/rustlings?tab=readme-ov-file
    3. After this I've just been building small projects, asking questions to more experienced people, and learning from the compiler haha as I find that I learn the best from experience
    4. Now I'm starting to work on some bigger projects and trying to contribute to open source projects here and there

    I hope that helps!

  10. cyberphysalis commented on Feb 20, 2025

    @cyberphysalis

    Hello, I am experiencing the same issue.
    In Tui, pressing Ctrl+Y causes the app to crash with the error message 'Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable'.
    I am running NixOS on Wayland. My terminal is Alacritty and Thoth is updated to the latest version.
    @jooaf

  11. jooaf commented on Feb 24, 2025

    @jooaf
    Owner

    @cyberphysalis Hi, thanks for letting me know! If it is possible could you help me debug this a little bit? Can you provide a full stack trace once the TUI panics? I don't have NixOS nor do I run on Wayland, so I'll have to do some investigation. Sorry for the inconvenience! I hope to get to this in the middle of the week once I have more time.

  12. jooaf commented on Feb 26, 2025

    @jooaf
    Owner

    @cyberphysalis I have this PR. If you don't mind could you check that out? Else, I can merge it in (I've done some testing but wanted to make sure that it works on your machine).

  13. cyberphysalis commented on Feb 27, 2025

    @cyberphysalis

    @jooaf I tested it, and the bug still exists. More information is provided below. Thank you for your support.

    thread 'main' panicked at src/scrollable_textarea.rs:225:50:
    called `Result::unwrap()` on an `Err` value: Unknown { .. } - "Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable"
    stack backtrace:
      0: rust_begin_unwind
      1: core::panicking::panic_fmt
      2: core::result::unwrap_failed
      3: thoth_cli::scrollable_textarea::ScrollableTextArea::copy_focused_textarea_contents
      4: thoth_cli::ui_handler::handle_normal_input
      5: thoth::main
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    
    thread 'main' panicked at src/scrollable_textarea.rs:225:50:
    called `Result::unwrap()` on an `Err` value: Unknown { .. } - "Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable"
    stack backtrace:
      0:     0x56392718d137 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h9754a6437f1de22a
      1:     0x563927138edb - core::fmt::write::hb706a393bb60a06f
      2:     0x56392718f68e - std::io::Write::write_fmt::h9b447dc5d824d0bd
      3:     0x5639271bde82 - std::panicking::default_hook::{{closure}}::h227952daede9dd84
      4:     0x5639271bed83 - std::panicking::rust_panic_with_hook::h76d2aa694a00748e
      5:     0x56392718d5a5 - std::panicking::begin_panic_handler::{{closure}}::h8855a344ffa1638b
      6:     0x56392718d509 - std::sys::backtrace::__rust_end_short_backtrace::h3110d0cbfbf26886
      7:     0x5639271be334 - rust_begin_unwind
      8:     0x5639270bfd02 - core::panicking::panic_fmt::h3af706d0346c1c60
      9:     0x5639270bf8e5 - core::result::unwrap_failed::h2ba69a02b8a8418b
      10:     0x5639271fc6a7 - thoth_cli::scrollable_textarea::ScrollableTextArea::copy_focused_textarea_contents::hb7cb1955d643e05b
      11:     0x563927211613 - thoth_cli::ui_handler::handle_normal_input::hf68c882c09c1648b
      12:     0x5639270dda45 - thoth::main::h24ae1ad19b057f62
      13:     0x5639270d1993 - std::sys::backtrace::__rust_begin_short_backtrace::h006155b710a5305a
      14:     0x5639270df838 - main
      15:     0x7f357ce6b27e - __libc_start_call_main
      16:     0x7f357ce6b339 - __libc_start_main_alias_2
      17:     0x5639270ce695 - _start
      18:                0x0 - <unknown>
    
  14. jooaf commented on Mar 6, 2025

    @jooaf
    Owner

    @cyberphysalis sorry to bother you again, but do you mind testing from the PR? I have found this issue with the clipboard library that I am using that has questionable (not necessarily bad support, rather people don't know if it is truly supported) support for Wayland. To get around this, a popup is displayed saying that the contents couldn't be copied and that the block was saved to a file. You can then use thoth read_clipboard or cargo r -- read_clipboard to get the contents of the block. Sorry, it isn't fully ideal. If we find that works for you (I ran some tests over ssh to kinda simulate a non X11 environment), then I may go ahead and tack on copying with wl-copy from the read_clipboard command (assuming thoth copy doesn't work).

    Thank you for your patience!

  15. cyberphysalis commented on Mar 7, 2025

    @cyberphysalis

    @jooaf It works as expected, displaying a pop-up. There's a typo to fix: the pop-up suggests the command 'thoth read-clipboard', but it should be thoth read_clipboard, with an underscore instead of a dash.

  16. jooaf commented on Mar 9, 2025

    @jooaf
    Owner

    @cyberphysalis excellent that is good to know. I've made that typo fix. Is this a satisfactory workaround for you? I'm tying to see if I can get wl-copy to be used instead if it is not a good workaround. Sorry again.

  17. cyberphysalis commented on Mar 10, 2025

    @cyberphysalis

    As a temporary solution, it works despite adding a couple of extra steps. It would be great if it could be fully fixed in the future.thanks for your help! @jooaf

  18. jooaf commented on Mar 10, 2025

    @jooaf
    Owner

    @cyberphysalis Ok cool, I'm going to merge this in. In the meantime, I'll do some research to see if I can fully rectify this. And sure no problem, thanks again for your patience :) !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0