Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stop Modifying User's RC Files#1753

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@thecoolwinter
Copy link
Collaborator

Description

Updates our terminal integration to be a little more clever about injections. Introduces aShellIntegration enum, which contains functions for setting up a pseudo terminal for supported shells.

Introduces a method for each shell for injecting our pre/post exec handlers:

  • zsh
    • Creates a temporary directory for the user and moves all our.zsh injection files into that temp folder.
    • Each.zsh injection file is an override for zsh's real init files (.zprofile,.zshenv,.zshrc,.zlogin).
    • Before initiating the terminal, we grab the user'szdotdir env variable and store it, replacing it with our own pointing to the temporary directory.
    • In each of CodeEdit's injected.zshX files, we source the user's real zsh init files exactly how zsh does it.
    • Then, in.zshrc, we do our injection code.
  • bash
    • We make use of the--init-file parameter for bash. Creating a new, interactive session using our own init file.
    • This init file also emulates exactly what bash would do upon init, sourcing the user's profile or.bashrc depending on if the session is a login session.
    • After initializing the session with the correct information, we install our pre/post exec functions.

These borrow some MIT-licensed code from VSCode and are documented as such, with permalinks to the source files.

Finally, because we're doing this at runtime we can allow users to opt-out of the injection mechanism in settings.

Related Issues

Checklist

  • I read and understood thecontributing guide as well as thecode of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Before (zsh example):

Screen.Recording.2024-06-12.at.4.48.06.PM.mov

After: init files still being sourced, not modifying the user's init files, and terminal titles still working.

Zsh:

Screen.Recording.2024-06-12.at.5.10.11.PM.mov

Bash:

Screen.Recording.2024-06-12.at.5.08.26.PM.mov

FastestMolasses reacted with rocket emoji
Copy link
Contributor

@bombardier200bombardier200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great work! Always good to fix a privacy issue!

@bombardier200bombardier200 merged commit23edf0e intoCodeEditApp:mainJun 13, 2024
@thecoolwinterthecoolwinter added the enhancementNew feature or request labelJul 19, 2024
@thecoolwinterthecoolwinter deleted the fix/modifying-users-intifiles branchJuly 20, 2024 02:37
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bombardier200bombardier200bombardier200 approved these changes

@FastestMolassesFastestMolassesFastestMolasses approved these changes

@austincondiffaustincondiffAwaiting requested review from austincondiff

@matthijseikelenboommatthijseikelenboomAwaiting requested review from matthijseikelenboom

@tom-ludwigtom-ludwigAwaiting requested review from tom-ludwig

Assignees

No one assigned

Labels

enhancementNew feature or requestterminal

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

✨ Stop editing users zsh file in order to set the terminal tab title

3 participants

@thecoolwinter@bombardier200@FastestMolasses

[8]ページ先頭

©2009-2025 Movatter.jp