title: VS Code not starting new terminal in current working directory
body: <p>I am running VS Code on Ubuntu 18.04 and running into a strange problem. I have not changed the configuration for the <code>terminal.integrated.cwd</code> setting, so I expect it to launch the terminal in the current working directory. Instead, it launches the terminal in the current working directory's parent directory.</p>
  <p>For example, let's say I launch VS Code from the following folder:</p>
  <pre class="lang-sh prettyprint-override"><code>pwd
  /home/rdawson/Coding/my-working-folder
  code .
  </code></pre>
  <p>The above will launch VS Code with <code>my-working-folder</code> showing its files.  So far so good.  Now, when I click on <code>Terminal &gt;&gt; New Teriminal</code>, a new terminal window will open, but it opens in the <code>/home/rdawson/Coding</code> directory instead of the <code>/home/rdawson/Coding/my-working-folder</code> diretory.  I have to manually <code>cd</code> into the <code>my-working-folder</code> directory.  This is annoying and unexpected behavior.</p>
  <p>I also opened VS Code and enabled tracing.  When I performed the same steps above, the following is what I saw:</p>
  <pre class="lang-sh prettyprint-override"><code>[2020-09-07 06:29:49.251] [renderer1] [trace] IPty#spawn /bin/bash [] {&quot;name&quot;:&quot;xterm-256color&quot;,&quot;cwd&quot;:&quot;/home/rdawson/Coding/my-working-folder&quot;,&quot;env&quot;:{&quot;GJS_DEBUG_TOPICS&quot;:&quot;JS ERROR;JS LOG&quot;,&quot;LESSOPEN&quot;:&quot;| /usr/bin/lesspipe %s&quot;,&quot;USER&quot;:&quot;rdawson&quot;,&quot;TEXTDOMAIN&quot;:&quot;im-config&quot;,&quot;XDG_SEAT&quot;:&quot;seat0&quot;,&quot;SSH_AGENT_PID&quot;:&quot;1892&quot;,&quot;XDG_SESSION_TYPE&quot;:&quot;x11&quot;,&quot;SHLVL&quot;:&quot;1&quot;,&quot;OLDPWD&quot;:&quot;/home/rdawson/Coding&quot;,&quot;QT4_IM_MODULE&quot;:&quot;xim&quot;,&quot;HOME&quot;:&quot;/home/rdawson&quot;,&quot;DESKTOP_SESSION&quot;:&quot;ubuntu&quot;,&quot;NVM_BIN&quot;:&quot;/home/rdawson/.nvm/versions/node/v12.18.3/bin&quot;,&quot;GNOME_SHELL_SESSION_MODE&quot;:&quot;ubuntu&quot;,&quot;GTK_MODULES&quot;:&quot;gail:atk-bridge&quot;,&quot;DBUS_SESSION_BUS_ADDRESS&quot;:&quot;unix:path=/run/user/1000/bus&quot;,&quot;COLORTERM&quot;:&quot;truecolor&quot;,&quot;NVM_DIR&quot;:&quot;/home/rdawson/.nvm&quot;,&quot;IM_CONFIG_PHASE&quot;:&quot;2&quot;,&quot;LOGNAME&quot;:&quot;rdawson&quot;,&quot;GTK_IM_MODULE&quot;:&quot;ibus&quot;,&quot;USERNAME&quot;:&quot;rdawson&quot;,&quot;XDG_SESSION_ID&quot;:&quot;3&quot;,&quot;TERM&quot;:&quot;xterm-256color&quot;,&quot;GNOME_DESKTOP_SESSION_ID&quot;:&quot;this-is-deprecated&quot;,&quot;WINDOWPATH&quot;:&quot;2&quot;,&quot;PATH&quot;:&quot;/home/rdawson/.nvm/versions/node/v12.18.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin&quot;,&quot;SESSION_MANAGER&quot;:&quot;local/linux:@/tmp/.ICE-unix/1796,unix/linux:/tmp/.ICE-unix/1796&quot;,&quot;XDG_MENU_PREFIX&quot;:&quot;gnome-&quot;,&quot;GNOME_TERMINAL_SCREEN&quot;:&quot;/org/gnome/Terminal/screen/069fd3dc_735e_47b3_8137_3f65efacb223&quot;,&quot;XDG_RUNTIME_DIR&quot;:&quot;/run/user/1000/snap.code&quot;,&quot;DISPLAY&quot;:&quot;:1&quot;,&quot;LANG&quot;:&quot;en_US.UTF-8&quot;,&quot;XDG_CURRENT_DESKTOP&quot;:&quot;Unity&quot;,&quot;LS_COLORS&quot;:&quot;rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:&quot;,&quot;XDG_SESSION_DESKTOP&quot;:&quot;ubuntu&quot;,&quot;XMODIFIERS&quot;:&quot;@im=ibus&quot;,&quot;GNOME_TERMINAL_SERVICE&quot;:&quot;:1.141&quot;,&quot;XAUTHORITY&quot;:&quot;/run/user/1000/gdm/Xauthority&quot;,&quot;SSH_AUTH_SOCK&quot;:&quot;/run/user/1000/keyring/ssh&quot;,&quot;GSETTINGS_SCHEMA_DIR&quot;:&quot;/snap/code/42/usr/share/glib-2.0/schemas&quot;,&quot;DISABLE_WAYLAND&quot;:&quot;1&quot;,&quot;SHELL&quot;:&quot;/bin/bash&quot;,&quot;QT_ACCESSIBILITY&quot;:&quot;1&quot;,&quot;GDMSESSION&quot;:&quot;ubuntu&quot;,&quot;LESSCLOSE&quot;:&quot;/usr/bin/lesspipe %s %s&quot;,&quot;TEXTDOMAINDIR&quot;:&quot;/usr/share/locale/&quot;,&quot;GJS_DEBUG_OUTPUT&quot;:&quot;stderr&quot;,&quot;GPG_AGENT_INFO&quot;:&quot;/run/user/1000/gnupg/S.gpg-agent:0:1&quot;,&quot;XDG_VTNR&quot;:&quot;2&quot;,&quot;QT_IM_MODULE&quot;:&quot;ibus&quot;,&quot;PWD&quot;:&quot;/home/rdawson/Coding/my-working-folder&quot;,&quot;CLUTTER_IM_MODULE&quot;:&quot;xim&quot;,&quot;XDG_DATA_DIRS&quot;:&quot;/usr/share/ubuntu:/home/rdawson/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop&quot;,&quot;XDG_CONFIG_DIRS&quot;:&quot;/etc/xdg/xdg-ubuntu:/etc/xdg&quot;,&quot;VTE_VERSION&quot;:&quot;5202&quot;,&quot;APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL&quot;:&quot;true&quot;,&quot;CHROME_DESKTOP&quot;:&quot;code-url-handler.desktop&quot;,&quot;ORIGINAL_XDG_CURRENT_DESKTOP&quot;:&quot;ubuntu:GNOME&quot;,&quot;TERM_PROGRAM&quot;:&quot;vscode&quot;,&quot;TERM_PROGRAM_VERSION&quot;:&quot;1.48.2&quot;,&quot;VSCODE_GIT_IPC_HANDLE&quot;:&quot;/run/user/1000/snap.code/vscode-git-dfe0817a77.sock&quot;,&quot;GIT_ASKPASS&quot;:&quot;/snap/code/42/usr/share/code/resources/app/extensions/git/dist/askpass.sh&quot;,&quot;VSCODE_GIT_ASKPASS_NODE&quot;:&quot;/snap/code/42/usr/share/code/code&quot;,&quot;VSCODE_GIT_ASKPASS_MAIN&quot;:&quot;/snap/code/42/usr/share/code/resources/app/extensions/git/dist/askpass-main.js&quot;},&quot;cols&quot;:157,&quot;rows&quot;:2,&quot;useConpty&quot;:false,&quot;conptyInheritCursor&quot;:false}
  </code></pre>
  <p>Based on the log file, it seems VS Code is using the <code>OLDPWD</code> instead of <code>PWD</code>.  Anyone have a solution for this?  I also run VS Code on Windows 10 and do not encounter this problem.</p>