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

Terminal not loading ~/.zshrc in the first go #83155

Closed
manassingh2611 opened this issue Oct 23, 2019 · 8 comments
Closed

Terminal not loading ~/.zshrc in the first go #83155

manassingh2611 opened this issue Oct 23, 2019 · 8 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@manassingh2611
Copy link

  • VSCode Version: 1.39.2 x64
  • OS Version: 4.19.0-kali5-amd64

Steps to Reproduce:

  1. Change your terminal to zsh using chsh -s command
  2. Make some changes in the ~/.zshrc
  3. Now launch vscode and hit Ctrl + `
  4. What you would notice is that changes in ~/.zshrc do not reflect in this terminal.
  5. Delete this terminal and create a new one.
  6. This new terminal works completely fine with all .

Does this issue occur when all extensions are disabled?: Yes

@vscodebot
Copy link

vscodebot bot commented Oct 23, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@Tyriar
Copy link
Member

Tyriar commented Oct 23, 2019

Some follow ups:

  • Did you have a VS Code window opened when you changed .zshrc, as the environment won't refresh until you close all windows.
  • Did zsh open or whatever your previous shell was?
  • Does it happen every time, regardless of chsh?
  • Enable trace logging https://github.com/microsoft/vscode/wiki/Terminal-Issues#enabling-trace-logging, and check the log for what args the first terminal was launched with and compare them to the second terminal's args

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Oct 23, 2019
@Bene-Graham
Copy link

I am also having this issue on MacOS Catalina.

What I have noticed is if you launch from the terminal it works correctly and loads zsh.

If you launch from the dock / launchpad / searchpad does not load zsh but instead bash

@manassingh2611
Copy link
Author

* Did you have a VS Code window opened when you changed `.zshrc`, as the environment won't refresh until you close all windows.

No the issue mostly happens on the first launch after startup.

* Did zsh open or whatever your previous shell was?

zsh opens but it does not load my oh-my-zsh theme and plugins in the first go. I have to delete the terminal and make a new one which works.

* Does it happen every time, regardless of `chsh`?

I never went back to using bash again. But this never happened with bash.

* Enable trace logging https://github.com/microsoft/vscode/wiki/Terminal-Issues#enabling-trace-logging, and check the log for what args the first terminal was launched with and compare them to the second terminal's args

The following exact line appears twice, and I see that it is correctly loading zsh dependencies from ~/.oh-my-zsh folder.

[2019-10-23 22:20:26.916] [renderer1] [trace] IPty#spawn /bin/zsh [] {"name":"xterm-256color","cwd":"/home/manas/coding","env":{"SHELL":"/bin/zsh","LSCOLORS":"Gxfxcxdxbxegedabagacad","SESSION_MANAGER":"local/kali:@/tmp/.ICE-unix/1598,unix/kali:/tmp/.ICE-unix/1598","QT_ACCESSIBILITY":"1","COLORTERM":"truecolor","LESS":"-R","XDG_MENU_PREFIX":"gnome-","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","LANGUAGE":"en_IN:en","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","DESKTOP_SESSION":"gnome","SSH_AGENT_PID":"1654","GTK_MODULES":"gail:atk-bridge","XDG_SEAT":"seat0","PWD":"/home/manas","LOGNAME":"manas","XDG_SESSION_DESKTOP":"gnome","XDG_SESSION_TYPE":"x11","GPG_AGENT_INFO":"/run/user/1000/gnupg/S.gpg-agent:0:1","XAUTHORITY":"/run/user/1000/gdm/Xauthority","WINDOWPATH":"2","GDM_LANG":"en_IN","HOME":"/home/manas","USERNAME":"manas","LANG":"en_GB.UTF-8","LS_COLORS":"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:*.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:","XDG_CURRENT_DESKTOP":"GNOME","VTE_VERSION":"5402","GNOME_TERMINAL_SCREEN":"/org/gnome/Terminal/screen/c270f0b9_c612_4eeb_aac6_013823af01a4","XDG_SESSION_CLASS":"user","TERM":"xterm-256color","ZSH":"/home/manas/.oh-my-zsh","USER":"manas","GNOME_TERMINAL_SERVICE":":1.71","DISPLAY":":1","SHLVL":"2","PAGER":"less","XDG_VTNR":"2","XDG_SESSION_ID":"3","XDG_RUNTIME_DIR":"/run/user/1000","XDG_DATA_DIRS":"/usr/share/gnome:/usr/local/share/:/usr/share/","PATH":"/home/manas/.local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin","GDMSESSION":"gnome","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1000/bus","OLDPWD":"/home/manas","_":"/usr/share/code/bin/../code","APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL":"true","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.39.2"},"cols":165,"rows":10,"experimentalUseConpty":false,"conptyInheritCursor":false}

@Tyriar
Copy link
Member

Tyriar commented Oct 23, 2019

/bin/zsh []

@kingmanas This means that zsh is run without any args which means .zshrc should run. Note that we don't run .zshrc but zsh itself does, there's nothing we can do to influence it other than via args and env vars. Maybe there's a conditional in your .zshrc preventing oh-my-zsh from loading?

@manassingh2611
Copy link
Author

@Tyriar There you go

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="bira"
#ZSH_THEME_RANDOM_CANDIDATES=(
	#"agnoster"
	#"robbyrussell"
#	"bira"
	#"arrow"
	#"amuse"
	#"af-magic"
#)

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
	git
	zsh-autosuggestions
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

@Tyriar
Copy link
Member

Tyriar commented Oct 23, 2019

@kingmanas you linked output from the bad terminal launching I'm assuming, can you do the same for the second (good) terminal so we can diff the args and env?

@vscodebot vscodebot bot closed this as completed Oct 31, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 31, 2019

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants