helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.76k stars 2.51k forks source link

Constructed args causes panic (xargs) #7599

Closed Takkaryx closed 1 year ago

Takkaryx commented 1 year ago

Summary

using grep -l to list files and piping it to helix causes a panic.

Reproduction Steps

  1. have a number of files with the word 'test' in them:
    grep -irnl test ./
    .//text4.txt
    .//text1.txt
    .//text3.txt
    .//text2.txt
  2. pipe the list to helix: grep -irnl test ./ | xargs hx

I expected this to happen: I expect helix to open with all files listed in the grep open as buffers to be edited.

Instead, this happened:

grep -irnl test ./ | xargs hx
thread 'main' panicked at 'reader source not set', /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/crossterm-0.26.1/src/event/read.rs:38:30
stack backtrace:
   0:        0x10bdd9e2a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h28eefff2fd6348c0
   1:        0x10b3e39ca - core::fmt::write::h49021f0d249bdcdd
   2:        0x10bdc4dbc - std::io::Write::write_fmt::hfe905b75ea2975e8
   3:        0x10bdd9c1a - std::sys_common::backtrace::print::h729e4781fcd708bf
   4:        0x10bdc0573 - std::panicking::default_hook::{{closure}}::he34a760df1040d15
   5:        0x10bdc0295 - std::panicking::default_hook::hc21c623951eeae76
   6:        0x10bdc1065 - std::panicking::rust_panic_with_hook::hf3038b3a4cc27e74
   7:        0x10bdda115 - std::panicking::begin_panic_handler::{{closure}}::h167648f6debe79bf
   8:        0x10bdd9f29 - std::sys_common::backtrace::__rust_end_short_backtrace::h998cad6508c9fd44
   9:        0x10bdc0b52 - _rust_begin_unwind
  10:        0x10bea4c93 - core::panicking::panic_fmt::h0c7b66c2bc0c7be6
  11:        0x10b3d810b - core::panicking::panic_display::h6fe5e8854f95d607
  12:        0x10b3d80bc - core::panicking::panic_str::h973aa1f461d8b814
  13:        0x10bea5119 - core::option::expect_failed::he8636b13f494d020
  14:        0x10b3f729a - <crossterm::event::stream::EventStream as core::default::Default>::default::hd19aed0c17f643e6
  15:        0x10bbbdb88 - tokio::runtime::park::CachedParkThread::block_on::h3214c7a6ca600984
  16:        0x10bc17f24 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::hd2ca5e778fe6bbd6
  17:        0x10bc43d68 - tokio::runtime::runtime::Runtime::block_on::h7aac2ff7a80153e2
  18:        0x10bc30b9c - hx::main::h3d0d9080287628a2
  19:        0x10bc0eed6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hc26c11a657da0ced
  20:        0x10bbf8731 - std::rt::lang_start::{{closure}}::haa59940c610f078e
  21:        0x10bdbf48c - std::rt::lang_start_internal::h87ee88830e566709
  22:        0x10bc30c8c - _main
  23:     0x7ff808aa241f - <unknown>

Helix log

there is no helix log, panics before it is generated.

Platform

macOS

Terminal Emulator

iterm2, warp, Terminal

Helix Version

helix 23.05 (7f5940be)

the-mikedavis commented 1 year ago

This looks like the same problem as https://github.com/helix-editor/helix/issues/2111, should be fixed by #5468

archseer commented 1 year ago

Closed as duplicate