Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

preserve history from parent shell in zsh#573

Merged
mangelajo merged 2 commits intojumpstarter-dev:mainfrom
bennyz:zsh-history
Jul 24, 2025
Merged

preserve history from parent shell in zsh#573
mangelajo merged 2 commits intojumpstarter-dev:mainfrom
bennyz:zsh-history

Conversation

@bennyz
Copy link
Copy Markdown
Member

@bennyz bennyz commented Jul 23, 2025

fixes #560

Summary by CodeRabbit

  • New Features

    • Improved zsh shell initialization by enabling incremental and shared history options.
    • Automatically sets the default history file for zsh if not already defined.
  • Style

    • Updated option formatting for bash shell arguments (no functional impact).

fixes #560

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 23, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 3d8c895
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/688232e6836ed400082b0561
😎 Deploy Preview https://deploy-preview-573--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 23, 2025

Walkthrough

This change updates the shell launching logic in the launch_shell function, specifically refining how bash and zsh shells are started. For zsh, it conditionally adds options to manage shell history and environment variables, while bash receives only a minor stylistic update to option formatting.

Changes

File(s) Change Summary
packages/jumpstarter/jumpstarter/common/utils.py Refined shell launching logic: conditional zsh option handling, environment variable setup, and minor bash formatting update.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant launch_shell
    participant Shell (bash/zsh)
    Note over launch_shell: Determine shell type
    alt bash
        launch_shell->>Shell (bash/zsh): Start with ["bash", "--norc", "--noprofile"]
    else zsh
        launch_shell->>Shell (bash/zsh): Start with ["zsh"] (+ "--no-rcs" if needed)
        alt HISTFILE not set
            launch_shell->>Shell (bash/zsh): Set HISTFILE=~/.zsh_history
        end
        launch_shell->>Shell (bash/zsh): Add "-o inc_append_history" and "-o share_history"
    end
Loading

Estimated code review effort

2 (~12 minutes)

Possibly related PRs

Poem

A shell for the bunny, with history to keep,
No more lost commands in a memory so deep.
Zsh now remembers, with options set right,
Bash gets its quotes, both ready for flight.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b2f264 and b87e027.

📒 Files selected for processing (1)
  • packages/jumpstarter/jumpstarter/common/utils.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: e2e
🔇 Additional comments (2)
packages/jumpstarter/jumpstarter/common/utils.py (2)

86-86: LGTM: Consistent quote style.

The change from single quotes to double quotes is purely stylistic and improves consistency with the rest of the codebase.


113-121: History options validation complete – ready to merge

All changes correctly implement the PR objective and no further fixes are required:

  • Verified that both inc_append_history and share_history (canonical INC_APPEND_HISTORY and SHARE_HISTORY) are valid Zsh options.
  • It’s safe to always include these flags regardless of use_profiles—they won’t conflict with loading or skipping RC files.
  • Optional style: for clarity you may prefer uppercase option names:
    cmd.extend(["-o", "inc_append_history", "-o", "share_history"])
    cmd.extend(["-o", "INC_APPEND_HISTORY", "-o", "SHARE_HISTORY"])

Great work preserving history in Zsh!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mangelajo mangelajo enabled auto-merge July 24, 2025 13:19
@mangelajo mangelajo merged commit 7365415 into jumpstarter-dev:main Jul 24, 2025
18 checks passed
@bennyz bennyz deleted the zsh-history branch July 24, 2025 22:27
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.

jmp shell should preserve commandline history

2 participants