Skip to content

Using commandline when trapping a signal in background #10126

Description

@iGr33k
~> fish --version
fish, version 3.6.1
~> echo $version
3.6.1
~> echo $TERM
alacritty
# OS is Manjaro with with i3 window manager.

Tried running with sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= fish' - produces the same behavior.

When in background, commandline "<cmd>" inside a function that handles signals doesn't actually insert text into the prompt.

Let's open two terminals:

# in the first one
function testfunc --on-signal SIGUSR1
   commandline -r "ls -la"
end
echo $fish_pid # xxxx

# in the second one
kill -SIGUSR1 xxxx

Produces no commands inserted into the first terminal. However, when sending the signal from the first terminal to itself, everything works as expected.
Furthermore, commandline -f execute would insert a newline as expected, and eval "ls -la" works as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions