Skip to content

Reattached to the wrong terminal #133542

Closed
Closed

Description

@roblourens

I just reloaded a window with my vscode-jupyter repo open, and it attached to a terminal which is already open in my vscode repo, so now this terminal is open in two windows:
Sep-21-2021 09-51-02

The right window is the window that originally owned this terminal

One thing about this terminal is that its cwd is some other folder outside of both workspaces, if that matters.

Activity

  1. roblourens commented on Sep 21, 2021

    @roblourens
    MemberAuthor

    I reloaded the left window again, and it reattached to the correct terminal.

    image

  2. added
    bug
    terminal
    terminal-persistence
    on Sep 21, 2021
  3. added this to the Backlog milestone on Sep 21, 2021
  4. roblourens commented on Feb 1, 2022

    @roblourens
    MemberAuthor

    Just so you know, this happens pretty often. I just reloaded a window and got some random terminal from another window. Let me know if I can collect any other info

  5. JacksonKearl commented on Feb 1, 2022

    @JacksonKearl
    Contributor

    Also hit this, I believe it was after restarting insiders for an update.

    Recording 2022-02-01 at 10 36 21

  6. meganrogge commented on Feb 1, 2022

    @meganrogge
    Collaborator

    I was able to repro once out of many attempts. I wonder if there's a command to reload all windows to simulate what happens on update? Maybe then I'd see it?

  7. Tyriar commented on Feb 4, 2022

    @Tyriar
    Contributor

    Megan Rogge (@meganrogge) exiting the application (cmd+q) and reopening it is essentially what happens on update

  8. JacksonKearl commented on Feb 9, 2022

    @JacksonKearl
    Contributor

    Something similar just happened with the most recent insiders update, but now the terminals aren't synced, it's just that the working directory of one window's terminal is set to the other window's root instead of it's own.

    image

  9. JacksonKearl commented on Feb 9, 2022

    @JacksonKearl
    Contributor

    Happened again, accidentally ran a destructive command in the wrong directory :(

    cc Daniel Imms (@Tyriar) Megan Rogge (@meganrogge) is there any logging or something I can enable to help you get to the bottom of this?

  10. meganrogge commented on Feb 9, 2022

    @meganrogge
    Collaborator

    I spent awhile investigating. I don't understand what could be going on here because we store and reconnect to terminals according to the workspaceId. Daniel Imms (@Tyriar) said that he thinks it's a race condition. Setting log level to trace and toggling the shared process would help when it reproes

  11. alexr00 commented on Feb 11, 2022

    @alexr00
    Member

    Today I had something new happen:

    1. I had 3 VS Code windows open.
    2. I reloaded window 1.
    3. Window 1 now shares a terminal with window 3! Totally different workspaces.

    No other windows were reloaded. No windows were closed. Is there a way I can disable terminal reconnect for local windows? I've also run destructive commands when this happens and I don't want to risk it.

  12. 101 remaining items

  13. alexr00 commented on Jun 30, 2023

    @alexr00
    Member

    I'll keep an eye out for this and try to maintain a setup similar that one that I just saw it with, but I have to say, this has gotten so much better. I almost never see it.

  14. alexr00 commented on Jun 30, 2023

    @alexr00
    Member

    I tried to repeat my setup before updating, and it did happen again.
    Setup:

    • Window 1 is vscode-pull-request-github2 : terminal cwd is outside the workspace and on a different drive (C vs D)
    • Window 2 is vscode-pull-request-github: terminals cwd were in the workspace
    • Window 3 is repo1: terminal cws was in the workspace
    • Window 4 is vscode: terminals cwd were all in the workspace

    After update:

    • Window 1 is vscode-pull-request-github2 : has a new terminal
    • Window 2 is vscode-pull-request-github: correct
    • Window 3 is repo1: has attached to Window 2's terminal and now they share the same terminal
    • Window 4 is vscode: correct

    Logs:

    2023-06-30 12:19:27.910 [info] Revived process, old id 3 -> new id 1
    2023-06-30 12:19:28.183 [info] Expanding terminal instance, old id 1 -> new id undefined
    2023-06-30 12:19:28.233 [info] Expanding terminal instance, old id 4 -> new id undefined
    2023-06-30 12:19:28.233 [warning] Couldn't get layout info, a terminal was probably disconnected Could not find pty on pty host
    2023-06-30 12:19:28.233 [info] Reattach to wrong terminal debug info - layout info by id {"relativeSize":1,"terminal":4}
    2023-06-30 12:19:28.236 [info] Reattach to wrong terminal debug info - _revivePtyIdMap [{"newId":1,"state":{"id":3,"shellLaunchConfig":{"icon":{"id":"terminal-powershell"},"executable":"C:\\Users\\alros\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.PowerShell_8wekyb3d8bbwe\\pwsh.exe","color":null,"useShellEnvironment":true},"processDetails":{"id":3,"title":"pwsh","titleSource":1,"pid":16904,"workspaceId":"dfe6bca14cf70957a5e0b4d02852452b","workspaceName":"vscode-pull-request-github","cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","isOrphan":false,"icon":{"id":"terminal-powershell"},"environmentVariableCollections":[["vscode.git",[["GIT_ASKPASS",{"variable":"GIT_ASKPASS","value":"c:\\Program Files\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass.sh","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_NODE",{"variable":"VSCODE_GIT_ASKPASS_NODE","value":"C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_EXTRA_ARGS",{"variable":"VSCODE_GIT_ASKPASS_EXTRA_ARGS","value":"--ms-enable-electron-run-as-node","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_MAIN",{"variable":"VSCODE_GIT_ASKPASS_MAIN","value":"c:\\Program Files\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass-main.js","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_IPC_HANDLE",{"variable":"VSCODE_GIT_IPC_HANDLE","value":"\\\\.\\pipe\\vscode-git-54ea0bee87-sock","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}]],[["",{"description":"Enables the following features: git auth provider"}]]]],"hasChildProcesses":false,"shellIntegrationNonce":"cabedd54-a605-4ed8-8c39-1a63e7be2bae"},"processLaunchConfig":{"env":{"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\alros\\AppData\\Roaming","ChocolateyInstall":"C:\\ProgramData\\chocolatey","ChocolateyLastPathUpdate":"133034006781636031","CHROME_CRASHPAD_PIPE_NAME":"\\\\.\\pipe\\LOCAL\\crashpad_7008_BWXUDWPPZKOQEDJO","CLIENTNAME":"ALROS-3","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","COMPUTERNAME":"ALROS-1","ComSpec":"C:\\WINDOWS\\system32\\cmd.exe","CYGWIN_HOME":"C:\\cygwin","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","EFC_2220":"0","FOO":"this_is_a_bar","GOPATH":"C:\\Users\\alros\\go","GYP_MSVS_VERSION":"2015","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\alros","INCLUDE":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\include","LIB":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib","LOCALAPPDATA":"C:\\Users\\alros\\AppData\\Local","LOGONSERVER":"\\\\DB3-RED-DC-08","NUMBER_OF_PROCESSORS":"12","NVM_HOME":"C:\\Users\\alros\\AppData\\Roaming\\nvm","NVM_SYMLINK":"C:\\Program Files\\nodejs","OneDrive":"C:\\Users\\alros\\OneDrive - Microsoft","OneDriveCommercial":"C:\\Users\\alros\\OneDrive - Microsoft","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","OS":"Windows_NT","Path":"C:\\Program Files\\Common Files\\microsoft shared\\Microsoft Online Services;C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Microsoft Online Services;C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;D:\\install\\powershell\\6\\;C:\\cygwin\\bin;C:\\Go\\bin;C:\\Program Files\\Microsoft VS Code Exploration\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin;C:\\Program Files\\Microsoft VS Code Insiders\\bin;C:\\Python27;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Users\\alros\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Yarn\\bin\\;C:\\Program Files\\CMake\\bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\Gpg4win\\..\\GnuPG\\bin;C:\\Program Files\\GitHub CLI\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\Users\\alros\\.cargo\\bin;C:\\Users\\alros\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\alros\\go\\bin;C:\\Users\\alros\\.dotnet\\tools;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE;C:\\Python27;C:\\Users\\alros\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;d:\\repos\\microsoft\\vscode\\scripts;C:\\Users\\alros\\AppData\\Local\\Yarn\\bin;C:\\Users\\alros\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\Scripts;C:\\Users\\alros\\.dotnet\\tools;C:\\Users\\alros\\AppData\\Local\\GitHubDesktop\\bin;C:\\ProgramData\\alros\\GitHubDesktop\\bin","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 85 Stepping 4, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"5504","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft Azure Information Protection\\Powershell","PUBLIC":"C:\\Users\\Public","PYTHON":"C:\\Python27\\python.exe","SESSIONNAME":"RDP-Tcp#0","SystemDrive":"C:","SystemRoot":"C:\\WINDOWS","TEMP":"C:\\Users\\alros\\AppData\\Local\\Temp","TMP":"C:\\Users\\alros\\AppData\\Local\\Temp","UATDATA":"C:\\windows\\CCM\\UATData\\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77","USERDNSDOMAIN":"REDMOND.CORP.MICROSOFT.COM","USERDOMAIN":"REDMOND","USERDOMAIN_ROAMINGPROFILE":"REDMOND","USERNAME":"alros","USERPROFILE":"C:\\Users\\alros","VS140COMNTOOLS":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\","windir":"C:\\WINDOWS","__COMPAT_LAYER":"DetectorsAppHealth","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.80.0-insider","LANG":"en_US.UTF-8","COLORTERM":"truecolor","GIT_ASKPASS":"c:\\Program Files\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass.sh","VSCODE_GIT_ASKPASS_NODE":"C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_GIT_ASKPASS_MAIN":"c:\\Program Files\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass-main.js","VSCODE_GIT_IPC_HANDLE":"\\\\.\\pipe\\vscode-git-54ea0bee87-sock"},"executableEnv":{"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\alros\\AppData\\Roaming","ChocolateyInstall":"C:\\ProgramData\\chocolatey","ChocolateyLastPathUpdate":"133034006781636031","CHROME_CRASHPAD_PIPE_NAME":"\\\\.\\pipe\\LOCAL\\crashpad_16072_MPZZDZVVZJBOERYY","CLIENTNAME":"ALROS-3","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","COMPUTERNAME":"ALROS-1","ComSpec":"C:\\WINDOWS\\system32\\cmd.exe","CYGWIN_HOME":"C:\\cygwin","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","EFC_2220":"0","FOO":"this_is_a_bar","GOPATH":"C:\\Users\\alros\\go","GYP_MSVS_VERSION":"2015","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\alros","INCLUDE":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\include","LIB":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib","LOCALAPPDATA":"C:\\Users\\alros\\AppData\\Local","LOGONSERVER":"\\\\DB3-RED-DC-08","NUMBER_OF_PROCESSORS":"12","NVM_HOME":"C:\\Users\\alros\\AppData\\Roaming\\nvm","NVM_SYMLINK":"C:\\Program Files\\nodejs","OneDrive":"C:\\Users\\alros\\OneDrive - Microsoft","OneDriveCommercial":"C:\\Users\\alros\\OneDrive - Microsoft","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","OS":"Windows_NT","Path":"C:\\Program Files\\Common Files\\microsoft shared\\Microsoft Online Services;C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Microsoft Online Services;C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;D:\\install\\powershell\\6\\;C:\\cygwin\\bin;C:\\Go\\bin;C:\\Program Files\\Microsoft VS Code Exploration\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin;C:\\Program Files\\Microsoft VS Code Insiders\\bin;C:\\Python27;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Users\\alros\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Yarn\\bin\\;C:\\Program Files\\CMake\\bin;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\Gpg4win\\..\\GnuPG\\bin;C:\\Program Files\\GitHub CLI\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\Users\\alros\\.cargo\\bin;C:\\Users\\alros\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\alros\\go\\bin;C:\\Users\\alros\\.dotnet\\tools;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE;C:\\Python27;C:\\Users\\alros\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;d:\\repos\\microsoft\\vscode\\scripts;C:\\Users\\alros\\AppData\\Local\\Yarn\\bin;C:\\Users\\alros\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\Scripts;C:\\Users\\alros\\.dotnet\\tools;C:\\Users\\alros\\AppData\\Local\\GitHubDesktop\\bin;C:\\ProgramData\\alros\\GitHubDesktop\\bin","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 85 Stepping 4, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"5504","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files (x86)\\Microsoft Azure Information Protection\\Powershell","PUBLIC":"C:\\Users\\Public","PYTHON":"C:\\Python27\\python.exe","SESSIONNAME":"RDP-Tcp#0","SystemDrive":"C:","SystemRoot":"C:\\WINDOWS","TEMP":"C:\\Users\\alros\\AppData\\Local\\Temp","TMP":"C:\\Users\\alros\\AppData\\Local\\Temp","UATDATA":"C:\\windows\\CCM\\UATData\\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77","USERDNSDOMAIN":"REDMOND.CORP.MICROSOFT.COM","USERDOMAIN":"REDMOND","USERDOMAIN_ROAMINGPROFILE":"REDMOND","USERNAME":"alros","USERPROFILE":"C:\\Users\\alros","VS140COMNTOOLS":"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\","VSCODE_CODE_CACHE_PATH":"C:\\Users\\alros\\AppData\\Roaming\\Code - Insiders\\CachedData\\c1bca6d7cc2c5f71ae04deda90c0cf50819ffde4","VSCODE_CWD":"C:\\Program Files\\Microsoft VS Code Insiders","VSCODE_IPC_HOOK":"\\\\.\\pipe\\72671c30d05ce318932621dac30dfd34-1.80.0-insider-main-sock","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"16072","windir":"C:\\WINDOWS","__COMPAT_LAYER":"DetectorsAppHealth"},"options":{"shellIntegration":{"enabled":true,"suggestEnabled":false,"nonce":"cabedd54-a605-4ed8-8c39-1a63e7be2bae"},"windowsEnableConpty":true,"environmentVariableCollections":[["vscode.git",[["GIT_ASKPASS",{"variable":"GIT_ASKPASS","value":"c:\\Program Files\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass.sh","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_NODE",{"variable":"VSCODE_GIT_ASKPASS_NODE","value":"C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_EXTRA_ARGS",{"variable":"VSCODE_GIT_ASKPASS_EXTRA_ARGS","value":"--ms-enable-electron-run-as-node","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_MAIN",{"variable":"VSCODE_GIT_ASKPASS_MAIN","value":"c:\\Program Files\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass-main.js","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_IPC_HANDLE",{"variable":"VSCODE_GIT_IPC_HANDLE","value":"\\\\.\\pipe\\vscode-git-54ea0bee87-sock","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}]],[["",{"description":"Enables the following features: git auth provider"}]]]],"workspaceFolder":{"uri":{"$mid":1,"fsPath":"d:\\repos\\Microsoft\\vscode-pull-request-github","_sep":1,"external":"file:///d%3A/repos/Microsoft/vscode-pull-request-github","path":"/d:/repos/Microsoft/vscode-pull-request-github","scheme":"file"},"name":"vscode-pull-request-github","index":0}}},"unicodeVersion":"11","replayEvent":{"events":[{"cols":258,"rows":17,"data":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> \u001b[93mgit \u001b[0mpull\r\nremote: Enumerating objects: 1, done.\r\nremote: Counting objects: 100% (1/1), done.\r\nremote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0\r\nUnpacking objects: 100% (1/1), 614 bytes | 61.00 KiB/s, done.\r\nFrom https://github.com/microsoft/vscode-pull-request-github\r\n   8cbac164..c6f00d59  main       -> origin/main\r\nUpdating 8cbac164..c6f00d59\r\nFast-forward\r\n src/commands.ts | 13 \u001b[32m++++++++++\u001b[31m---\r\n\u001b[0m 1 file changed, 10 insertions(+), 3 deletions(-)\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github> \u001b[93mgit \u001b[0mpull\r\nAlready up to date.\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github> \u001b[93mgit \u001b[0mcheckout \u001b[90m-b \u001b[0mrelease/0.68\r\nSwitched to a new branch 'release/0.68'\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github> \u001b[93mgit \u001b[0mpush\r\nfatal: The current branch release/0.68 has no upstream branch.\r\nTo push the current branch and set the remote as upstream, use\r\n\r\n    git push --set-upstream origin release/0.68\r\n\r\nTo have this happen automatically for branches without a tracking\r\nupstream, see 'push.autoSetupRemote' in 'git help config'.\r\n\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github> \u001b[93mgit \u001b[0mpush \u001b[90m--set-upstream \u001b[0morigin release/0.68\r\nTotal 0 (delta 0), reused 0 (delta 0), pack-reused 0\r\nremote:\r\nremote: Create a pull request for 'release/0.68' on GitHub by visiting:\r\nremote:      https://github.com/microsoft/vscode-pull-request-github/pull/new/release/0.68\r\nremote:\r\nTo https://github.com/microsoft/vscode-pull-request-github.git\r\n * [new branch]        release/0.68 -> release/0.68\r\nbranch 'release/0.68' set up to track 'origin/release/0.68'.\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github>\u001b[1C\u001b[93mgit \u001b[0mcheckout main\r\nSwitched to branch 'main'\r\nYour branch is up to date with 'origin/main'.\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github>\u001b[1C\u001b[93mgit \u001b[0mcheckout \u001b[90m-b \u001b[0malexr00/disablePrerelease \u001b[38;5;238m    \r\n\u001b[0mSwitched to a new branch 'alexr00/disablePrerelease'\r\nPS D:\\repos\\Microsoft\\vscode-pull-request-github>\u001b[1C"}],"commands":{"isWindowsPty":true,"commands":[{"startLine":0,"endLine":11,"executedLine":0,"command":"git pull","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":0,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git pull --unshallow","timestamp":1688104913850},{"startLine":11,"endLine":13,"executedLine":11,"command":"git pull","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":0,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git pull --unshallow","timestamp":1688104992406},{"startLine":13,"endLine":14,"executedLine":13,"command":"git checkout -b release/0.68","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":0,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git checkout -b release/0.68","timestamp":1688105048380},{"startLine":15,"endLine":23,"executedLine":15,"command":"git push","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":1,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git push --set-upstream origin release/1.80","timestamp":1688105055685},{"startLine":24,"endLine":32,"executedLine":24,"command":"git push --set-upstream origin release/0.68","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":0,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git push --set-upstream origin release/0.68","timestamp":1688105063631},{"startLine":33,"endLine":35,"executedLine":33,"command":"git checkout main","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":0,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git checkout main","timestamp":1688113116127},{"startLine":36,"endLine":37,"executedLine":36,"command":"git checkout -b alexr00/disablePrerelease","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","exitCode":0,"commandStartLineContent":"PS D:\\repos\\Microsoft\\vscode-pull-request-github> git checkout -b alexr00/disablePrerelease     ","timestamp":1688113158174},{"startLine":37,"startX":52,"command":"","isTrusted":true,"cwd":"D:\\repos\\Microsoft\\vscode-pull-request-github","timestamp":0}]}},"timestamp":1688120353450}}]
    2023-06-30 12:19:28.488 [info] Expanding terminal instance, old id 3 -> new id 1
    2023-06-30 12:19:28.865 [warning] Persistent process "1": Process had no disconnect runners but was an orphan
    2023-06-30 12:19:28.866 [info] Persistent process reconnection "1"
    2023-06-30 12:19:29.410 [info] Persistent process "1": Replaying 2108 chars and 1 size events
    2023-06-30 12:19:29.487 [info] Revived process, old id 2 -> new id 2
    2023-06-30 12:19:29.572 [info] Expanding terminal instance, old id 2 -> new id 2
    2023-06-30 12:19:32.741 [warning] Persistent process "2": Process had no disconnect runners but was an orphan
    2023-06-30 12:19:32.742 [info] Persistent process reconnection "2"
    2023-06-30 12:19:32.762 [warning] Persistent process "1": Process had no disconnect runners but was an orphan
    2023-06-30 12:19:32.763 [info] Persistent process reconnection "1"
    2023-06-30 12:19:33.420 [info] Persistent process "2": Replaying 5919 chars and 1 size events
    2023-06-30 12:19:33.428 [info] Persistent process "1": Replaying 2108 chars and 1 size events
    
  15. Tyriar commented on Jun 30, 2023

    @Tyriar
    Contributor

    Thanks Alex Ross (@alexr00), it seems there's some inconsistency with the layout info and the revived procs, so I suspect this silently error swallowing now:

    Added logs for that here: #186732, I'll merge for July so you might not be able to test for a week but when you do please also grab the Terminal output log as this is renderer side.

  16. Tyriar commented on Jul 3, 2023

    @Tyriar
    Contributor

    Cross post #186922 (comment)

    I think I've identified a problem, since revive can happen after startup (eg. open a new window with a folder), this could introduce conflicts in _revivedPtyIdMap. _revivedPtyIdMap should include the workspace ID in its key

  17. Tyriar commented on Jul 3, 2023

    @Tyriar
    Contributor

    With Megan Rogge (@meganrogge)'s logs in #186922, I was able to reproduce the problem!

    image

    The repro is very complicated, it is essentially trying to get into a state where 2+ windows have "old pty ids" that conflict with one another, and then increasing the latency of the pty host in order to force the race condition to show itself.

    1. Set these settings:
      "terminal.integrated.persistentSessionReviveProcess": "onExitAndWindowClose",
      "terminal.integrated.developer.ptyHost.latency": 500
      
    2. Set default log level to trace
    3. Close all windows
    4. Open window 1 (W1) with folder A
    5. W1: Open 2 terminals
    6. W1: Close window
    7. W1: Open window
    8. W1: Open pty host log, you should see this:
      2023-07-03 12:54:57.963 [info] Expanding terminal instance, old id 1 -> new id 1
      2023-07-03 12:54:57.963 [info] Expanding terminal instance, old id 2 -> new id 2
      
    9. Open window 2 (W2) with folder B
    10. W2: Open 2 terminals
    11. W1: Close window
    12. W2: Close window
    13. Open VS Code (W2 should open)
    14. W2: Open pty host log, you should something like this:
      2023-07-03 12:54:57.963 [info] Expanding terminal instance, old id 3 -> new id 1
      2023-07-03 12:54:57.963 [info] Expanding terminal instance, old id 4 -> new id 2
      
    15. W2: Close window
    16. Open an external terminal and type code
    17. Open another external terminal and type code <folder A>
    18. Run the commands in both terminals in quick succession
    19. W1|W2: Open pty host log, you should see something like this:
      2023-07-03 13:01:56.461 [info] Expanding terminal instance, old id 1 -> new id 3
      2023-07-03 13:01:56.461 [info] Expanding terminal instance, old id 2 -> new id 4
      2023-07-03 13:01:57.086 [info] Expanding terminal instance, old id 1 -> new id undefined
      2023-07-03 13:01:57.086 [info] Expanding terminal instance, old id 2 -> new id undefined
      

    The terminal with new id undefined end up attaching to the wrong pty.


    The fix for this is simple, just add workspace ID as part of the key of the old id, so 1 becomes <folder B hash>-1. This should make conflicts impossible to occur.

  18. added a commit that references this issue on Jul 3, 2023
    e963d92
  19. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Jul 3, 2023
  20. locked and limited conversation to collaborators on Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugimportantinsiders-releasedpapercut 🩸terminal-persistenceverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions