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

workspaceFolderBasename variable is not resolving immediately after window load #115560

Closed
geneing opened this issue Feb 1, 2021 · 7 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) remote Remote system operations issues terminal-profiles
Milestone

Comments

@geneing
Copy link

geneing commented Feb 1, 2021

Issue Type: Bug

In order to avoid multiple remote tmux sessions, I set in settings.json the following
"terminal.integrated.shell.linux": "/usr/bin/tmux",
"terminal.integrated.shellArgs.linux": [
"new-session",
"-A",
"-s",
"${workspaceFolderBasename}"
],

I expect that workspaceFolderBasename variable contains valid value. However, initally or after window reload this variable is not set. It is only set correctly after I switch source code tabs or open a file.

This is a problem when using remote sessions, because this happens every time I reconnect to the remote session and VSCode tells me to reload window.

VS Code version: Code 1.52.1 (ea3859d, 2020-12-16T16:34:46.910Z)
OS version: Windows_NT x64 10.0.18363
Remote OS version: Linux x64 4.15.0-45-generic
Remote OS version: Linux x64 4.15.0-45-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.85GB (14.78GB free)
Process Argv --crash-reporter-id 43e1efde-3d38-401f-a9f5-1b22f067980f
Screen Reader no
VM 0%
Item Value
Remote SSH: elephant.itw
OS Linux x64 4.15.0-45-generic
CPUs Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz (32 x 3051)
Memory (System) 62.87GB (28.44GB free)
VM 0%
Item Value
Remote SSH: elephant.itw
OS Linux x64 4.15.0-45-generic
CPUs Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz (32 x 3051)
Memory (System) 62.87GB (28.44GB free)
VM 0%
Extensions (13)
Extension Author (truncated) Version
remote-ssh ms- 0.63.0
remote-ssh-edit ms- 0.63.0
remote-wsl ms- 0.52.0
githistory don 0.6.14
gitlens eam 11.1.3
vscoq max 0.3.2
python ms- 2021.1.502429796
vscode-pylance ms- 2021.1.3
jupyter ms- 2020.12.414227025
cmake-tools ms- 1.5.3
cpptools ms- 1.1.3
biosyntax rea 0.0.9
vscodeintellicode Vis 1.2.11
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
openlogontheside:30221877
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30211401
wsl2prompt:30224612
pythonvsdeb440:30248342
unusedprompt:30224610
folderexplorercf:30224615
openfilemenu:30224647
pythonvsded773:30248341
pythonvspyt875:30251590

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label labels Feb 2, 2021
@meganrogge meganrogge added this to the Backlog milestone Feb 2, 2021
@Just-Insane
Copy link

Just-Insane commented May 19, 2021

Were you able to find a solution for this? I have this in settings.json:

"terminal.integrated.profiles.linux": {
  "tmux ws-session": {
    "path": "tmux",
    "args": [
      "new-session",
      "-A",
      "-s",
      "vscode-${workspaceFolderBasename}"
    ]
  },
}

and the "osx" version works correctly locally (it's identical), but whenever I use Remote-SSH my tmux session is named vscode-${workspaceFolderBasename}, even after killing all terminal sessions, opening a remote file, and then re-opening tmux.

@zix99
Copy link

zix99 commented Jun 15, 2021

This is impacting me too, but I was able to come up with this work-around (but it isn't pretty...)

In your remote config, replace the other config with this line (Replace path as appropriate):

{
  "terminal.integrated.shell.linux": "/path/to/home/bin/code-tmux"
}

And code-tmux should look like this:

#!/bin/bash
exec tmux new-session -A -s vscode-$(basename $PWD)

Hope it helps for now until config variables work again here.

@lukebennett
Copy link

@zix99 works a treat, nice one!

@Tyriar
Copy link
Member

Tyriar commented Jul 7, 2021

Related: #126066

@Tyriar Tyriar modified the milestones: July 2021, August 2021 Jul 26, 2021
@Tyriar Tyriar modified the milestones: August 2021, Backlog Aug 23, 2021
@Tyriar Tyriar changed the title workspaceFolderBasename variable in settings.json is not set initially workspaceFolderBasename variable is not resolving immediately after window load Oct 14, 2021
@diegohavenstein
Copy link

In my case it is not resolving at all, not even after reload. Tried it on the current vs code and with the insiders edition, running on Mac OS. Tried using it within user setting and within workspace setting, as part of the clangd configuration

@xgdgsc
Copy link
Contributor

xgdgsc commented Apr 29, 2022

When I work with julia extension with tmux persistent mode. It's really weird on start REPL the workspaceFolderBasename resolves correctly while after use for sometime, on trying to stop REPL the workspaceFolderBasename resolves to empty. Don' t know if it' s related. It only started happening in very recent versions.

@Tyriar Tyriar self-assigned this Dec 6, 2022
@Tyriar Tyriar removed the terminal General terminal issues that don't fall under another label label Dec 9, 2022
@Tyriar
Copy link
Member

Tyriar commented Dec 12, 2022

/duplicate #81231

@Tyriar Tyriar closed this as completed Dec 12, 2022
@vscodenpa vscodenpa added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 12, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) remote Remote system operations issues terminal-profiles
Projects
None yet
Development

No branches or pull requests

9 participants