tmux-thumbs icon indicating copy to clipboard operation
tmux-thumbs copied to clipboard

thumbs panics when pipe to external program

Open ghost opened this issue 5 years ago • 5 comments

Os: Arch terminal: alacritty

git log | thumbs -u -r | xclip -selection clipboard -i

Output:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 25, kind: Other, message: "Inappropriate ioctl for device" }', /home/demxk/.cargo/registry/src/github.com-1ecc6299db9ec823/thumbs-0.4.4/src/view.rs:259:69
With RUST_BACKTRACE=1

stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:217
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:526
  11: rust_begin_unwind
             at src/libstd/panicking.rs:437
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  13: core::option::expect_none_failed
             at src/libcore/option.rs:1269
  14: thumbs::view::View::present
  15: thumbs::main
  16: std::rt::lang_start::{{closure}}
  17: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  18: std::panicking::try::do_call
             at src/libstd/panicking.rs:348
  19: std::panicking::try
             at src/libstd/panicking.rs:325
  20: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  21: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  22: main
  23: __libc_start_main
  24: _start

ghost avatar Oct 06 '20 16:10 ghost

I can reproduce it. When you don't pipe it to xclip it works, right? Edit: This fails at view.rs#259 which calls this: https://github.com/redox-os/termion/blob/master/src/raw.rs#L100

That's about the extent I can troubleshoot this, don't know enough on terminals to figure out why it returns the error:

Err value: Os { code: 25, kind: Other, message: "Inappropriate ioctl for device" }'

pbartyik avatar Oct 13 '20 19:10 pbartyik

There is a thread un rust lang forums about this:

https://users.rust-lang.org/t/termion-intorawmode-read-from-stdin-error/27574

Not sure how to solve it.

fcsonline avatar Oct 24 '20 18:10 fcsonline

Hi! I really like the idea of thumbs as a standalone command, but no mater to what I try pipe it, I'm getting this error. Is there a workaround for this? Because honestly, I don't know how to use it. Or it's like the only intended use, that doesn't work in some configurations?

So for now I'm using tmux-thumbs aliases with custom --command, but it would be nice to be able to use it outside the tmux and not only with captured-pane.

Nice plugin btw. 👍

rafcamlet avatar Jun 09 '22 15:06 rafcamlet

encounting same problem

dongdongbh avatar Nov 10 '22 03:11 dongdongbh