Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"bash: cannot set terminal process group (-1): Inappropriate ioctl for device" when open Visual Studio Code integrated terminal #315

Closed
ghost opened this issue May 16, 2022 · 6 comments · Fixed by #375

Comments

@ghost
Copy link

ghost commented May 16, 2022

Linux distribution and kernel version

Arch Linux x86_64
5.17.7-arch1-1

Flatpak version

Flatpak 1.12.7

Description of the problem

When I configure the integrated terminal according to the flatpak_warning.txt in the config file located in ~/.var/app/com.visualstudio.code/config/Code/User/settings.json

{
  "terminal.integrated.defaultProfile.linux": "bash",
  "terminal.integrated.profiles.linux": {
    "bash": {
      "path": "/usr/bin/flatpak-spawn",
      "args": ["--host", "--env=TERM=xterm-256color", "bash"]
    }
  }
}

I get the following message every time I open the integrated terminal

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

image

@nikodunk
Copy link
Contributor

I get this too but the terminal works just fine. Does your terminal work?

@tinywrkb
Copy link

tinywrkb commented Jul 12, 2022

You need a new pty to avoid the controlling terminal issue. This can be achieved with script.

"terminal.integrated.profiles.linux": {
  "Host: Bash (new pty)": {
    "path": "/usr/bin/flatpak-spawn",
    "args": ["--env=TERM=vscode", "--host", "script", "--quiet", "/dev/null"]
  },
  "Host: ZSH (new pty)": {
    "path": "/usr/bin/flatpak-spawn",
    "args": ["--env=TERM=vscode", "--env=SHELL=zsh", "--host", "script", "--quiet", "/dev/null"]
  }
}

@tinywrkb
Copy link

host-spawn is even better.

@ferrybig
Copy link

ferrybig commented Nov 2, 2022

You need a new pty to avoid the controlling terminal issue. This can be achieved with script.

"terminal.integrated.profiles.linux": {
  "Host: Bash (new pty)": {
    "path": "/usr/bin/flatpak-spawn",
    "args": ["--env=TERM=vscode", "--host", "script", "--quiet", "/dev/null"]
  },
  "Host: ZSH (new pty)": {
    "path": "/usr/bin/flatpak-spawn",
    "args": ["--env=TERM=vscode", "--env=SHELL=zsh", "--host", "script", "--quiet", "/dev/null"]
  }
}

For some reason, your solution makes the /usr/bin directory different in the spawned shell, compared to the hosts /usr/bin directory, so not every command works

@fiantyogalihp
Copy link

You need a new pty to avoid the controlling terminal issue. This can be achieved with script.

"terminal.integrated.profiles.linux": {
  "Host: Bash (new pty)": {
    "path": "/usr/bin/flatpak-spawn",
    "args": ["--env=TERM=vscode", "--host", "script", "--quiet", "/dev/null"]
  },
  "Host: ZSH (new pty)": {
    "path": "/usr/bin/flatpak-spawn",
    "args": ["--env=TERM=vscode", "--env=SHELL=zsh", "--host", "script", "--quiet", "/dev/null"]
  }
}

the issue is fixed, but can't run some command properly

@kramfs
Copy link

kramfs commented Dec 19, 2022

host-spawn is even better.

I concur, host-spawn is a better solution. Here's a simple config:

    "terminal.integrated.defaultProfile.linux": "bash",
    "terminal.integrated.profiles.linux": {
        "bash": {
          "path": "/var/home/kramfs/.local/bin/host-spawn",
          "icon": "terminal"
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants