Skip to content

get zsh startup files to run in the correct order#147434

Merged
meganrogge merged 17 commits intomainfrom
merogge/zsh-revamp
Apr 19, 2022
Merged

get zsh startup files to run in the correct order#147434
meganrogge merged 17 commits intomainfrom
merogge/zsh-revamp

Conversation

@meganrogge
Copy link
Copy Markdown
Collaborator

This PR fixes #145824

@meganrogge meganrogge self-assigned this Apr 14, 2022
@meganrogge meganrogge added this to the April 2022 milestone Apr 14, 2022
@meganrogge
Copy link
Copy Markdown
Collaborator Author

meganrogge commented Apr 18, 2022

With shell integration disabled:
Screen Shot 2022-04-18 at 8 20 21 AM

With shell integration enabled:
Screen Shot 2022-04-18 at 9 08 35 AM

@meganrogge
Copy link
Copy Markdown
Collaborator Author

meganrogge commented Apr 18, 2022

With these changes, when shell integration is enabled:

  • the scripts in blue still run before the shell integration script
  • thereafter, they run in the right order only when I explicitly set RCS and GLOBAL_RCS in the script because those are getting unset somehow
    Screen Shot 2022-04-18 at 8 23 40 AM

@meganrogge
Copy link
Copy Markdown
Collaborator Author

meganrogge commented Apr 18, 2022

Even when shell integration is disabled, after the startup files have run, RCS and GLOBAL_RCS are unset.

@meganrogge
Copy link
Copy Markdown
Collaborator Author

Using setopt and unsetopt, I realized I should instead be checking the value of norcs and noglobalrcs

@meganrogge
Copy link
Copy Markdown
Collaborator Author

meganrogge commented Apr 18, 2022

Last thing to solve for:

  • the scripts in the blue box run before the shell integration script
  • in order to run the scripts in order, they must be run again
  • will this cause problems?
  • is there a way to prevent them from running before?
    Screen Shot 2022-04-18 at 9 39 14 AM

@meganrogge
Copy link
Copy Markdown
Collaborator Author

Those are running before the script because our shell integration script is getting run as the .zshrc in the ZDOTDIR

@meganrogge
Copy link
Copy Markdown
Collaborator Author

meganrogge commented Apr 18, 2022

So the real question is why are the user's startup files not getting run between the global ones.

That's because ZDOTDIR is used instead of home directory when ZDOTDIR is set.

So it's looking for if ZDOTDIR exists (it does) and is looking for zprofile etc in there (where it doesn't exist). so we need to copy files to ZDOTDIR that contain scripts that will run ~/.zprofile etc.

@meganrogge meganrogge merged commit e7c6ad7 into main Apr 19, 2022
@meganrogge meganrogge deleted the merogge/zsh-revamp branch April 19, 2022 02:16
@meganrogge
Copy link
Copy Markdown
Collaborator Author

deferred handling RCS and GLOBAL_RCS to #147802

@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Startup files invoked in the wrong order for zsh with shell integration

1 participant