terminated tab remains open #10673

Closed
opened 2026-01-31 02:27:08 +00:00 by claunia · 8 comments
Owner

Originally created by @zsbolyoczki on GitHub (Sep 18, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.450]
Windows Terminal version (if applicable): 1.2.2381.0

Steps to reproduce

  1. open ssh terminal
  2. exit the terminal (press CTRL - D)
  3. sometimes the tab remains open with exit code greater than zero

Expected behavior

There should be an option to close tabs regardless the exit code.

Originally created by @zsbolyoczki on GitHub (Sep 18, 2020). # Environment ``` Windows build number: Microsoft Windows [Version 10.0.19041.450] Windows Terminal version (if applicable): 1.2.2381.0 ``` # Steps to reproduce 1. open ssh terminal 2. exit the terminal (press CTRL - D) 3. sometimes the tab remains open with exit code greater than zero # Expected behavior There should be an option to close tabs regardless the exit code.
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 02:27:08 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 18, 2020):

You know, there is already an option to control if tabs closeOnExit, maybe you should check out the docs

@zadjii-msft commented on GitHub (Sep 18, 2020): You know, there is already an option to control if tabs `closeOnExit`, maybe you should check out the [docs](https://github.com/microsoftdocs/terminal)
Author
Owner

@zsbolyoczki commented on GitHub (Sep 18, 2020):

I'm aware of that option and it's set to "closeOnExit": "always"

@zsbolyoczki commented on GitHub (Sep 18, 2020): I'm aware of that option and it's set to ``"closeOnExit": "always"``
Author
Owner

@DHowett commented on GitHub (Sep 18, 2020):

Thanks. Since it looks like closeOnExit isn't working, could you share a copy (or the appropriate snippet) of your settings.json?

@DHowett commented on GitHub (Sep 18, 2020): Thanks. Since it looks like `closeOnExit` isn't working, could you share a copy (or the appropriate snippet) of your settings.json?
Author
Owner

@zsbolyoczki commented on GitHub (Sep 21, 2020):

settings.json

//
// https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md#profiles
//

{
  "$schema": "https://aka.ms/terminal-profiles-schema",
  "wordDelimiters": " \"'<>,:;=()[]{}", 
  "alwaysShowTabs": true,
  "closeOnExit": "always",
  "theme": "dark",
  "defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
  "copyOnSelect": true,
  "copyFormatting": false,
  "largePasteWarning": false,
  "multiLinePasteWarning": false,
  "profiles": {
    "defaults": {
      // https://atomcorp.github.io/themes/
      "colorScheme": "Dracula",
      "cursorShape": "vintage"
    },
    "list": [ {
        "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
        "hidden": false,
        "name": "Ubuntu-20.04",
        "source": "Windows.Terminal.Wsl",
        "padding": "20, 20, 10, 10",
        "selectionBackground": "#ffbbcc",

      },
      {
        "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
        "hidden": false,
        "name": "Azure Cloud Shell",
        "source": "Windows.Terminal.Azure"
      },
      {
          "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
          "hidden": false,
          "name": "Ubuntu-20.04",
          "source": "Windows.Terminal.Wsl"
      }
    ]
  },
  "schemes": [  {
      "name": "Afterglow",
      "black": "#151515",
      "red": "#ac4142",
      "green": "#7e8e50",
      "yellow": "#e5b567",
      "blue": "#6c99bb",
      "purple": "#9f4e85",
      "cyan": "#7dd6cf",
      "white": "#d0d0d0",
      "brightBlack": "#505050",
      "brightRed": "#ac4142",
      "brightGreen": "#7e8e50",
      "brightYellow": "#e5b567",
      "brightBlue": "#6c99bb",
      "brightPurple": "#9f4e85",
      "brightCyan": "#7dd6cf",
      "brightWhite": "#f5f5f5",
      "background": "#212121",
      "foreground": "#d0d0d0"
    },
    {
      // https://draculatheme.com/
      "name" : "Dracula",
      "background" : "#272935",
      "black" : "#21222C",
      "blue" : "#BD93F9",
      "cyan" : "#8BE9FD",
      "foreground" : "#F8F8F2",
      "green" : "#50FA7B",
      "purple" : "#FF79C6",
      "red" : "#FF5555",
      "white" : "#F8F8F2",
      "yellow" : "#FFB86C",
      "brightBlack" : "#6272A4",
      "brightBlue" : "#D6ACFF",
      "brightCyan" : "#A4FFFF",
      "brightGreen" : "#69FF94",
      "brightPurple" : "#FF92DF",
      "brightRed" : "#FF6E6E",
      "brightWhite" : "#F8F8F2",
      "brightYellow" : "#FFFFA5"
    },
    {
      "name": "Breeze",
      "black": "#31363b",
      "red": "#ed1515",
      "green": "#11d116",
      "yellow": "#f67400",
      "blue": "#1d99f3",
      "purple": "#9b59b6",
      "cyan": "#1abc9c",
      "white": "#eff0f1",
      "brightBlack": "#7f8c8d",
      "brightRed": "#c0392b",
      "brightGreen": "#1cdc9a",
      "brightYellow": "#fdbc4b",
      "brightBlue": "#3daee9",
      "brightPurple": "#8e44ad",
      "brightCyan": "#16a085",
      "brightWhite": "#fcfcfc",
      "background": "#31363b",
      "foreground": "#eff0f1"
    },
    {
      "name": "Calamity",
      "black": "#2f2833",
      "red": "#fc644d",
      "green": "#a5f69c",
      "yellow": "#e9d7a5",
      "blue": "#3b79c7",
      "purple": "#f92672",
      "cyan": "#74d3de",
      "white": "#d5ced9",
      "brightBlack": "#7e6c88",
      "brightRed": "#fc644d",
      "brightGreen": "#a5f69c",
      "brightYellow": "#e9d7a5",
      "brightBlue": "#3b79c7",
      "brightPurple": "#f92672",
      "brightCyan": "#74d3de",
      "brightWhite": "#ffffff",
      "background": "#2f2833",
      "foreground": "#d5ced9"
    }
  ]
}
"keybindings": [
  { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
  { "command": "paste", "keys": "ctrl+v" },
  { "command": "find", "keys": "ctrl+shift+f" },
  { "command": "newTab", "keys": "ctrl+shift+t"},
  { "command": { "action": "splitPane", "split": "vertical" }, "keys": "alt+shift+-" }
  
]
}
@zsbolyoczki commented on GitHub (Sep 21, 2020): settings.json ``` // // https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md#profiles // { "$schema": "https://aka.ms/terminal-profiles-schema", "wordDelimiters": " \"'<>,:;=()[]{}", "alwaysShowTabs": true, "closeOnExit": "always", "theme": "dark", "defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", "copyOnSelect": true, "copyFormatting": false, "largePasteWarning": false, "multiLinePasteWarning": false, "profiles": { "defaults": { // https://atomcorp.github.io/themes/ "colorScheme": "Dracula", "cursorShape": "vintage" }, "list": [ { "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", "hidden": false, "name": "Ubuntu-20.04", "source": "Windows.Terminal.Wsl", "padding": "20, 20, 10, 10", "selectionBackground": "#ffbbcc", }, { "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", "hidden": false, "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure" }, { "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", "hidden": false, "name": "Ubuntu-20.04", "source": "Windows.Terminal.Wsl" } ] }, "schemes": [ { "name": "Afterglow", "black": "#151515", "red": "#ac4142", "green": "#7e8e50", "yellow": "#e5b567", "blue": "#6c99bb", "purple": "#9f4e85", "cyan": "#7dd6cf", "white": "#d0d0d0", "brightBlack": "#505050", "brightRed": "#ac4142", "brightGreen": "#7e8e50", "brightYellow": "#e5b567", "brightBlue": "#6c99bb", "brightPurple": "#9f4e85", "brightCyan": "#7dd6cf", "brightWhite": "#f5f5f5", "background": "#212121", "foreground": "#d0d0d0" }, { // https://draculatheme.com/ "name" : "Dracula", "background" : "#272935", "black" : "#21222C", "blue" : "#BD93F9", "cyan" : "#8BE9FD", "foreground" : "#F8F8F2", "green" : "#50FA7B", "purple" : "#FF79C6", "red" : "#FF5555", "white" : "#F8F8F2", "yellow" : "#FFB86C", "brightBlack" : "#6272A4", "brightBlue" : "#D6ACFF", "brightCyan" : "#A4FFFF", "brightGreen" : "#69FF94", "brightPurple" : "#FF92DF", "brightRed" : "#FF6E6E", "brightWhite" : "#F8F8F2", "brightYellow" : "#FFFFA5" }, { "name": "Breeze", "black": "#31363b", "red": "#ed1515", "green": "#11d116", "yellow": "#f67400", "blue": "#1d99f3", "purple": "#9b59b6", "cyan": "#1abc9c", "white": "#eff0f1", "brightBlack": "#7f8c8d", "brightRed": "#c0392b", "brightGreen": "#1cdc9a", "brightYellow": "#fdbc4b", "brightBlue": "#3daee9", "brightPurple": "#8e44ad", "brightCyan": "#16a085", "brightWhite": "#fcfcfc", "background": "#31363b", "foreground": "#eff0f1" }, { "name": "Calamity", "black": "#2f2833", "red": "#fc644d", "green": "#a5f69c", "yellow": "#e9d7a5", "blue": "#3b79c7", "purple": "#f92672", "cyan": "#74d3de", "white": "#d5ced9", "brightBlack": "#7e6c88", "brightRed": "#fc644d", "brightGreen": "#a5f69c", "brightYellow": "#e9d7a5", "brightBlue": "#3b79c7", "brightPurple": "#f92672", "brightCyan": "#74d3de", "brightWhite": "#ffffff", "background": "#2f2833", "foreground": "#d5ced9" } ] } "keybindings": [ { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }, { "command": "paste", "keys": "ctrl+v" }, { "command": "find", "keys": "ctrl+shift+f" }, { "command": "newTab", "keys": "ctrl+shift+t"}, { "command": { "action": "splitPane", "split": "vertical" }, "keys": "alt+shift+-" } ] } ```
Author
Owner

@DHowett commented on GitHub (Sep 21, 2020):

Ah! You will need to move closeOnExit into the profiles.defaults section. Since we made it a per-profile property (so that you could set closeOnExit differently for WSL and for your "production server SSH" or whatever profiles), it has to go into the profiles section.

Does that work for you?

@DHowett commented on GitHub (Sep 21, 2020): Ah! You will need to move `closeOnExit` into the `profiles.defaults` section. Since we made it a per-profile property (so that you could set `closeOnExit` differently for WSL and for your "production server SSH" or whatever profiles), it has to go into the profiles section. Does that work for you?
Author
Owner

@zsbolyoczki commented on GitHub (Sep 21, 2020):

Give me a couple of hours to test it because it doesn't happen every time.

@zsbolyoczki commented on GitHub (Sep 21, 2020): Give me a couple of hours to test it because it doesn't happen every time.
Author
Owner

@DHowett commented on GitHub (Sep 21, 2020):

I can usually make this happen reliably by pressing ^C ^D. This makes zsh at least exit with code 130, which is regarded as a failure.

@DHowett commented on GitHub (Sep 21, 2020): I can usually make this happen reliably by pressing ^C ^D. This makes zsh at least exit with code 130, which is regarded as a failure.
Author
Owner

@zsbolyoczki commented on GitHub (Sep 22, 2020):

It seems OK, thanks for the info!
I close the issue.

@zsbolyoczki commented on GitHub (Sep 22, 2020): It seems OK, thanks for the info! I close the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10673