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

Initialize McFly only in interactive shell #428

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

akinomyoga
Copy link
Contributor

In the current setup for Bash and Fish, only keybindings are disabled in non-interactive shells, but the other settings (including PROMPT_COMMAND, MCFLY_SESSION_ID, etc.) are still loaded. Do they need to be loaded in the non-interactive shells? On the other hand, in the Zsh setup, they are not enabled in non-interactive shells because there is a check [[ -o interactive ]] at the beginning of mcfly.zsh (though there is an extra check for the interactive shell also for the keybindings in Zsh).

In this PR, I suggest skipping all the initialization in non-interactive shells to make it consistent with Zsh, which I guess is the natural behavior. I also remove the redundant check for the interactive shells in the later part of the Zsh integration.

If these settings (other than keybindings) are intentionally enabled in non-interactive shells of Bash and Fish, please let me know. I can adjust or close the PR. Thank you.

@cantino cantino merged commit baffaf8 into cantino:master Jul 17, 2024
19 checks passed
@cantino
Copy link
Owner

cantino commented Jul 17, 2024

Thanks @akinomyoga!

@akinomyoga akinomyoga deleted the shell-interactive branch July 17, 2024 02:35
@akinomyoga
Copy link
Contributor Author

Thanks! I'll submit other PRs (I waited for this PR to avoid unnecessary conflicts caused by the merging order).

In case you missed it, I replied to your email at around 21:25 on Thu, 11 Jul 2024 (PDT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants