out-of-cheese-error / the-way

A code snippets manager for your terminal.
MIT License
354 stars 16 forks source link

EDITOR with space #80

Closed lengyijun closed 3 years ago

lengyijun commented 3 years ago
$ echo $EDITOR
vim -N -u NONE

$ RUST_BACKTRACE=1 the-way new                                                                                                                                               
✔ Description · cgo
✔ Language · go
✔ Tags (space separated) · 
✔ Code snippet (<RET> to edit in external editor) · 
Error: 
   0: No such file or directory (os error 2)

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 2 frames hidden ⋮                               
   3: the_way::utils::external_editor_input::hcbbab1d7fe9610eb
      at <unknown source file>
   4: the_way::the_way::snippet::Snippet::from_user::h807f2b0215308756
      at <unknown source file>
   5: the_way::the_way::TheWay::run::hc7651f9367a8cabe
      at <unknown source file>
   6: the_way::the_way::TheWay::start::hdaa9914ca7162356
      at <unknown source file>
   7: the_way::main::h54fb7cb483b9714d
      at <unknown source file>
   8: std::sys_common::backtrace::__rust_begin_short_backtrace::h1d6ae41c2286663c
      at <unknown source file>
   9: std::rt::lang_start::{{closure}}::h55da07d914c978cf
      at <unknown source file>
  10: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h5867dc20a6af6cac
      at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8/library/core/src/ops/function.rs:259
  11: std::panicking::try::do_call::h32e8dcce59f53a45
      at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8/library/std/src/panicking.rs:381
  12: std::panicking::try::h7d7b073280e6de2f
      at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8/library/std/src/panicking.rs:345
  13: std::panic::catch_unwind::h801333b3e4e7d79f
      at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8/library/std/src/panic.rs:382
  14: std::rt::lang_start_internal::h2c157bf657c6892a
      at /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8/library/std/src/rt.rs:51
  15: main
      at <unknown source file>
  16: __libc_start_main
      at <unknown source file>
  17: _start
      at <unknown source file>

Suggestion: Set your default editor using the $EDITOR or $VISUAL environment variables

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

This is a bug in https://github.com/mitsuhiko/dialoguer/issues/87

Ninjani commented 3 years ago

Thanks for the issue and the fix @lengyijun ! I'll push a new release as soon as dialoguer does

lengyijun commented 3 years ago

I feel that it require more tests on mac and windows before updating dialoguer dependency.

Ninjani commented 3 years ago

Works on Mac with the new release so I'll go ahead and update!

(Fixed in v0.10.1)