Skip to content

Hang when exiting subshell #7060

@dnicolson

Description

@dnicolson

If the following code is run as go run subshell.go, the terminal session in iTerm2 can become unresponsive and cause the fish process to run at 99% CPU.

package main

import "os"
import "os/exec"

func main() {
	cmd := exec.Command(os.Getenv("SHELL"), "--login")
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	cmd.Stdin = os.Stdin
	cmd.Run()
}
  1. go run subshell.go
  2. Hit Control-C
  3. Hit enter
  4. Hit enter

This results in the following output before the terminal session becomes unresponsive:

$ go run subshell.go
$ signal: interrupt
$ ⏎
$
$
$

The output of the Terminal app is similar, except the terminal session closes and fish stops running.

Performing the above steps with fish 2.7.1 does not have the same issue.

fish 3.1.2
Darwin Kernel Version 19.5.0: root:xnu-6153.121.1~7/RELEASE_X86_64 x86_64
xterm-256color
iTerm 3.3.11beta1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions