Skip to content

stty in your config.fish causes externally backgrounded fish instances to stop #5246

@jorgebucaran

Description

@jorgebucaran

Using stty in your config.fish causes background processes to suddenly stop.

To reproduce the issue add to your config.fish the following code.

stty werase undef

Then send any job to the background using &.

$ fish -c "echo" &
Job 1, 'fish -c "echo" &' has stopped

Running jobs tells me:

Job	Group	State	Command
1	83624	stopped	fish -c "echo" &

I can bring the process to the foreground using fg to finish it.

$ fg
Send job 1, 'fish -c "echo" &' to foreground
stty: tcsetattr: Interrupted system call

I know that wrapping the stty command like so:

if status --is-interactive
    ...
end

...will prevent the issue, but it's unfriendly to tell people how to write their configuration.

This issue was discovered by @tyilo while using jorgebucaran/fisher (see jorgebucaran/fisher#469). The presence of stty in their configuration causes fisher to hang because fisher keeps waiting for a process that is stopped.

I've been able to reproduce this issue on macOS, Linux (Arch) / xterm-256color running fish 2.0.0, 2.2.0, 2.7.1, and the latest fish from HEAD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions