Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thumbs panics when pipe to external program #66

Open
ghost opened this issue Oct 6, 2020 · 5 comments
Open

thumbs panics when pipe to external program #66

ghost opened this issue Oct 6, 2020 · 5 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@ghost
Copy link

ghost commented Oct 6, 2020

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

@pbartyik
Copy link
Contributor

pbartyik commented Oct 13, 2020

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" }'

@fcsonline
Copy link
Owner

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 fcsonline added the bug Something isn't working label Dec 1, 2020
@fcsonline fcsonline added the wontfix This will not be worked on label Feb 6, 2022
@rafcamlet
Copy link

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. 👍

@dongdongbh
Copy link

encounting same problem

@egovelox
Copy link

Hi !
I got the error on the standalone, note that it happens only when i pipe the result.

Please, are we sure we won't fix it ?

On MacOS Sonoma 14.1

git log | thumbs -u -r > output.thumb
thread 'main' panicked at /Users/maxime.richard/DEV/rust/.cargo/registry/src/index.crates.io-6f17d22bba15001f/thumbs-0.7.1/src/view.rs:298:69:
called `Result::unwrap()` on an `Err` value: Os { code: 25, kind: Uncategorized, message: "Inappropriate ioctl for device" }
stack backtrace:
   0:        0x10420e080 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h41035ce174e31160
   1:        0x104225880 - core::fmt::write::h7e946826fce7616b
   2:        0x10420bed0 - std::io::Write::write_fmt::he3645adfefb23e4a
   3:        0x10420ded8 - std::sys_common::backtrace::print::h2efe9ae66fda73dc
   4:        0x10420f0b0 - std::panicking::default_hook::{{closure}}::hd27200b4fbd3bf40
   5:        0x10420ed7c - std::panicking::default_hook::hb8656334461229c8
   6:        0x10420f95c - std::panicking::rust_panic_with_hook::h10171cf76e1aed15
   7:        0x10420f398 - std::panicking::begin_panic_handler::{{closure}}::h9344de43a47cae21
   8:        0x10420e504 - std::sys_common::backtrace::__rust_end_short_backtrace::h55013ada3ab9c4e8
   9:        0x10420f108 - _rust_begin_unwind
  10:        0x1042333d0 - core::panicking::panic_fmt::h0b16bb09366e1f01
  11:        0x1042336f4 - core::result::unwrap_failed::h0a2eea50cb43dc63
  12:        0x104107090 - thumbs::view::View::present::hfa4c076a7461a5df
  13:        0x104110b78 - thumbs::main::h5454a86926b0c66c
  14:        0x10411413c - std::sys_common::backtrace::__rust_begin_short_backtrace::hef5ce4776932695c
  15:        0x104114154 - std::rt::lang_start::{{closure}}::hf5cd580d3b3205f2
  16:        0x104207e2c - std::rt::lang_start_internal::h27a134f18d582a1e
  17:        0x104111388 - _main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants