Skip to content

Variant of the No TTY for interactive shell #4178

Closed

Description

I've been experiencing a persistent variant of the No TTY for interactive shell error trying to install oh-my-fish on fish v2.6.0:

≻ curl -L https://get.oh-my.fish | fish
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    426      0 --:--:-- --:--:-- --:--:--   427
100 16622  100 16622    0     0  25023      0 --:--:-- --:--:-- --:--:-- 25023
Existing installation detected at /Users/patrick.bohan/.local/share/omf
Would you like to remove the existing installation? (y/N): <W> fish: No TTY for interactive shell (tcgetpgrp failed)
setpgid: Inappropriate ioctl for device

Requested ticket information:

≻ fish --version
fish, version 2.6.0
≻ echo $version
2.6.0
≻ uname -a
Darwin patrickbohanwerallyin.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
≻ echo $TERM
xterm-256color

It does indeed when I run without customizations, i.e. sh -c 'env HOME=$(mktemp -d) fish'.
I'm rather new to fish -- I've mostly stuck to customizing my fish_prompt -- but I'm at a loss for what change might have done this. I'm happy to narrow this down on my own but I'm not entirely sure the best way to do that. (I tried fish --debug-level=3 but I'm not sure exactly what I might be looking for.)

I tried the alternate install and the first read succeeded but a second one failed. I got a stack trace that might (hopefully) is useful:

[patrick.bohan|~]0≻ curl -L https://get.oh-my.fish > install
                    fish install --path=~/.local/share/omf --config=~/.config/omf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    384      0 --:--:-- --:--:-- --:--:--   385
100 16622  100 16622    0     0  24041      0 --:--:-- --:--:-- --:--:-- 24041
Existing installation detected at /Users/patrick.bohan/.local/share/omf
Would you like to remove the existing installation? (y/N): ⏎                                                                                                                                                                                                                  read> y
This will uninstall Oh My Fish and all plugins and themes from
/Users/patrick.bohan/.local/share/omf.
Are you sure you want to continue? (y/N): <E> fish: src/reader.cpp:1559: failed assertion: input_initialized
<E> fish: Backtrace:
<E> fish: 0   reader_push(wchar_t const*) + 1056
<E> fish: 1   builtin_read(parser_t&, io_streams_t&, wchar_t**) + 1482
<E> fish: 2   builtin_run(parser_t&, wchar_t const* const*, io_streams_t&) + 334
<E> fish: 3   exec_job(parser_t&, job_t*) + 3736
<E> fish: 4   parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
<E> fish: 5   parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 6   parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
<E> fish: 7   parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
<E> fish: 8   parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
<E> fish: 9   parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t) + 134
<E> fish: 10  internal_exec_helper(parser_t&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, unsigned int, block_type_t, io_chain_t const&) + 1017
<E> fish: 11  exec_job(parser_t&, job_t*) + 2885
<E> fish: 12  parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
<E> fish: 13  parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 14  parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
<E> fish: 15  parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
<E> fish: 16  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
<E> fish: 17  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t) + 134
<E> fish: 18  internal_exec_helper(parser_t&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, unsigned int, block_type_t, io_chain_t const&) + 1017
<E> fish: 19  exec_job(parser_t&, job_t*) + 2885
<E> fish: 20  parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
<E> fish: 21  parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 22  parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
<E> fish: 23  parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
<E> fish: 24  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
<E> fish: 25  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t) + 134
<E> fish: 26  internal_exec_helper(parser_t&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, unsigned int, block_type_t, io_chain_t const&) + 1017
<E> fish: 27  exec_job(parser_t&, job_t*) + 2885
<E> fish: 28  parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
<E> fish: 29  parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 30  parse_execution_context_t::run_if_statement(parse_node_t const&) + 461
<E> fish: 31  parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 529
<E> fish: 32  parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 33  parse_execution_context_t::run_if_statement(parse_node_t const&) + 461
<E> fish: 34  parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 529
<E> fish: 35  parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 36  parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
<E> fish: 37  parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
<E> fish: 38  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
<E> fish: 39  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t) + 134
<E> fish: 40  internal_exec_helper(parser_t&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, unsigned int, block_type_t, io_chain_t const&) + 1017
<E> fish: 41  exec_job(parser_t&, job_t*) + 2885
<E> fish: 42  parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
<E> fish: 43  parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
<E> fish: 44  parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
<E> fish: 45  parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
<E> fish: 46  parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
<E> fish: 47  reader_read(int, io_chain_t const&) + 1877
<E> fish: 48  main + 3118
<E> fish: 49  start + 1
<E> fish: 50  53  ???                                 0x0000000000000004 0x0 + 4
fish: 'fish install --path=~/.local/sh…' terminated by signal SIGABRT (Abort)
[patrick.bohan|~]134≻

Unfortunately I haven't found any work around for this problem. I've looked at several seemingly related tickets ( #3805 , #3345 , #2980, #1844 ) but none appeared to be helpful for my situation.

Any help would be greatly appreciated.

Activity

  1. krader1961 commented on Jul 2, 2017

    @krader1961
    Contributor

    I had no problem using either installation method:

    > fish install --path=~/.local/share/omf --config=~/.config/omf
    Installing Oh My Fish to /Users/krader/.local/share/omf...
    Using release channel "stable".
    Cloning master from https://github.com/oh-my-fish/oh-my-fish.git...
    Writing bootstrap to /Users/krader/.config/fish/conf.d/omf.fish...
    Existent fish_prompt.fish found at /Users/krader/.config/fish/functions
    ↳ Moving to /Users/krader/.config/fish/functions/fish_prompt.1499027438.copy
    Setting up Oh My Fish configuration...
    Updating https://github.com/oh-my-fish/packages-main master... Done!
    Installing package default
    ✔ default successfully installed.
    Installation successful!
    

    I do, however, see both failure modes when I attempt to reinstall OMF. So you can solve your immediate problem by first uninstalling OMF before installing it again:

    > rm -rf ~/.local/share/omf
    > rm ~/.config/fish/conf.d/omf.fish
    

    You don't need OMF to reproduce this problem. Create a file named read-bug containing this:

    function confirm
        read -l answer < /dev/tty
        echo "answer=|$answer|"
    end
    
    confirm
    

    Now type echo yes | fish read-bug. This is probably another manifestation of problems caused by fish trying to put itself into its own process group at startup.

  2. tomsmeding commented on Jul 8, 2017

    @tomsmeding
    Contributor

    The testcase mentioned here, with the read-bug file, first throws an error after commit 5809608. The testcase mentioned in #4199 first crashes on an assertion after commit 6d02bec. These are quite some commits apart.

  3. tomsmeding commented on Jul 8, 2017

    @tomsmeding
    Contributor

    In particular, the config.fish testcase in #4199 still works in 5809608, and the tty read bug here is still present in 6d02bec.

  4. mqudsi commented on Sep 10, 2017

    @mqudsi
    Contributor

    This is probably another manifestation of problems caused by fish trying to put itself into its own process group at startup.

    No, I think this is more about the problem with functions that try to take control of the terminal when called as part of a pipeline, à la #3952

    In all cases, it still reproduces after 55b3c45, which disabled the new process group on startup code.

  5. pcascio commented on Sep 12, 2017

    @pcascio

    I also have this problem when trying to run this script for cleaning up my unused Homebrew formulae: https://github.com/connorworley/dotfiles/blob/master/.bin/brew-autoremove

    fish --version
    fish, version 2.6.0
    echo $version
    2.6.0
    uname -a
    Darwin Cascio-MBP 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
    echo $TERM
    ansi

    My stack:

    ./brew-autoremove.sh
    Searching for formulas not depended on by other formulas...
    activemq is not depended on by other formulas. Remove? [Y/n] n
    fish: src/reader.cpp:1559: failed assertion: input_initialized
    fish: Backtrace:
    fish: 0 reader_push(wchar_t const*) + 1056
    fish: 1 builtin_read(parser_t&, io_streams_t&, wchar_t**) + 1482
    fish: 2 builtin_run(parser_t&, wchar_t const* const*, io_streams_t&) + 334
    fish: 3 exec_job(parser_t&, job_t*) + 3736
    fish: 4 parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
    fish: 5 parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
    fish: 6 parse_execution_context_t::run_if_statement(parse_node_t const&) + 461
    fish: 7 parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 529
    fish: 8 parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
    fish: 9 parse_execution_context_t::run_for_statement(parse_node_t const&, parse_node_t const&) + 378
    fish: 10 parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 357
    fish: 11 parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
    fish: 12 parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
    fish: 13 parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
    fish: 14 parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
    fish: 15 parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t) + 134
    fish: 16 internal_exec_helper(parser_t&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, unsigned int, block_type_t, io_chain_t const&) + 1017
    fish: 17 exec_job(parser_t&, job_t*) + 2885
    fish: 18 parse_execution_context_t::run_1_job(parse_node_t const&, block_t const*) + 1204
    fish: 19 parse_execution_context_t::run_job_list(parse_node_t const&, block_t const*) + 117
    fish: 20 parse_execution_context_t::eval_node_at_offset(unsigned int, block_t const*, io_chain_t const&) + 403
    fish: 21 parser_t::eval_block_node(unsigned int, io_chain_t const&, block_type_t) + 140
    fish: 22 parser_t::eval(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, io_chain_t const&, block_type_t, parse_node_tree_t) + 230
    fish: 23 reader_read(int, io_chain_t const&) + 1877
    fish: 24 main + 3118
    fish: 25 start + 1
    fish: './brew-autoremove.sh' terminated by signal SIGABRT (Abort)

  6. mqudsi commented on Sep 15, 2017

    @mqudsi
    Contributor

    The assertion failed issue should be tracked here: #4199

    There are two distinct bugs here, though there is some correlation between the two.

  7. tastyminerals commented on Oct 3, 2017

    @tastyminerals

    Experiencing the same behaviour after installing fish and trying to install oh-my-fish via sudo fish install --path=~/.local/share/omf --config=~/.config/omf or simply running ./bin/install from git cloned oh-my-fish dir. Any updates?

  8. boxed commented on Nov 11, 2017

    @boxed

    I just ran into this same problem, also with omf. The workaround above worked fine.

  9. mqudsi commented on Sep 29, 2018

    @mqudsi
    Contributor

    fwiw, fish no longer crashes on this case. Instead, the following message is printed:

    mqudsi@freebsd ~/fish-shell> echo yes | fish read-bug
    <W> fish: I appear to be an orphaned process, so I am quitting politely. My pid is 67738.
  10. added 6 commits that reference this issue on Sep 29, 2018
    a1eb780
    dbb4a9e
    aa121f1
    477703d
    9e8a78c
    1956596
  11. 9 remaining items

  12. added 6 commits that reference this issue on Oct 19, 2018
    5dcec40
    3015b45
    e05f1be
    67165bb
    6184c15
    475be24
  13. modified the milestones: fish-future, fish-3.0 on Oct 27, 2018
  14. added a commit that references this issue on Oct 27, 2018
    af0c8d5
  15. added a commit that references this issue on Nov 24, 2018
    3674eeb
  16. added 3 commits that reference this issue on Jan 22, 2019
  17. locked as resolved and limited conversation to collaborators on Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions