fish-shell / fish-shell/fish-shell

piping `echo` into another processes creates a job group with negative number

Open
#9,712 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
34.2k
Forks
2.4k
Avg merge
2d 8h
Merged PRs (30d)
13

Description

I tried this with `sh -c 'env HOME=$(mktemp -d) fish'`

```
> fish --version
fish, version 3.6.1`

> uname -a
Linux Tugge 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

> echo $TERM
xterm-256color

> wezterm --version
wezterm 20230326-111934-3666303c

> vim --version
VIM - Vi IMproved 8.2
```

Scenario:
```
> echo "" | vim -
```

`CTRL-Z`

```
Vim: Reading from stdin...
fish: Job 1, 'echo "" | vim -' has stopped

> fg
fg: There are no suitable jobs

[2]> fg %1
fg: Can't put job 132830, 'echo "" | vim -' to foreground because it is not under job control

[2]> jobs
Job Group CPU State Command
1 -2 0% stopped echo "" | vim -

> exit
There are still jobs active:

PID Command
0 echo "" | vim -

A second attempt to exit will terminate them.
Use 'disown PID' to remove jobs from the list without terminating them.
```

After start `echo "" | vim -` doing ctrl-z, the jobs list has one item but I'm not able to foreground it because it is "not under job control". Is that expected behavior?

In bash it is possible to foreground the vim process again. I expected the same in fish.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.