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

When resizing the VS Code terminal fnm spams 'Can't infer shell' errors #1329

Open
efindus opened this issue Nov 17, 2024 · 1 comment
Open

Comments

@efindus
Copy link

efindus commented Nov 17, 2024

My issue is mostly described above. I tried investigating the cause and I think that this happens because my fish prompt (Tide) calls fish when rendering the prompt, causing fnm env --use-on-cd | source to run. If the terminal is resized quickly enough the rendering of the prompt may be cancelled, which apparently orphans the fnm process, preventing it from finding any shell in its process tree. Currently my solution is to manually set the shell type, but it does not feel ideal (and I don't really know which of the three involved projects should this issue be filed on).

One related grudge is that when there are any errors (such as when the node version from .node-version is not installed) they get logged each time the prompt renders (because the script generated by fnm env --use-on-cd calls the cd hook when sourced), breaking the prompt/making it appear twice.

I wanted to fix both of these myself but none of the solutions I tried were very practical outside of my particular setup, hence this isn't a PR as I originally intended.

@pbgc
Copy link

pbgc commented Dec 9, 2024

@efindus I have the same exact problem using fish with tide and fmm, but with alacritty (With kitty risize works .. but if I quickly several times the return key in the shell .. I get the same problem).
Resizing gives me:

failed printing to stdout: Broken pipe (os error 32)
stack backtrace:
   0:        0x1024f844c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h192489893ab3de20
   1:        0x102512018 - core::fmt::write::h2573968dce8b4c8e
   2:        0x1024f8194 - std::io::Write::write_fmt::hd688b4e0e14280fb
   3:        0x1024eb900 - std::panicking::default_hook::{{closure}}::h132ab4fd80cbd688
   4:        0x1024eb448 - std::panicking::default_hook::h25db1205ededf4a8
   5:        0x1024ebe84 - std::panicking::rust_panic_with_hook::h1a5e700ba9552453
   6:        0x1024f898c - std::panicking::begin_panic_handler::{{closure}}::h4b087c40eb4a42d9
   7:        0x1024f86a4 - std::sys::backtrace::__rust_end_short_backtrace::heff777664c13f8e2
   8:        0x1024eba70 - _rust_begin_unwind
   9:        0x1025300c4 - core::panicking::panic_fmt::h681f622c7f427738
  10:        0x1024eae14 - std::io::stdio::_print::h7f071412a7c976ac
  11:        0x102194a08 - fnm::commands::command::Command::call::h6810c4bca4a3a983
  12:        0x1021e59d8 - fnm::main::hcfbf743badcede60
  13:        0x1021cdc5c - std::sys::backtrace::__rust_begin_short_backtrace::h332e024228cc7a7e
  14:        0x1021d9f58 - std::rt::lang_start::{{closure}}::hf4bf66bf87cb0a43
  15:        0x1024fbbf0 - std::rt::lang_start_internal::h9c7d71c5826f1ac3
  16:        0x1021e686c - _main
~ ❯ thread 'rustc' panicked at std/src/io/stdio.rs:1117:9:
failed printing to stdout: Broken pipe (os error 32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants