Conversation
- In Zsh: removed `_correct` and `_approximate` from `zstyle ':completion:*' completer`, added `unsetopt correct` and `unsetopt correct_all`, and removed the `SPROMPT` variable export from `prompt.tmpl`. - In Bash: added `shopt -u cdspell` and `shopt -u dirspell` to disable directory spellcheck auto-corrections in `dot_bash_profile.tmpl`. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request disables spelling correction and completion features across Bash and Zsh configurations. It removes the Zsh spelling prompt and completion correction styles, while explicitly disabling 'cdspell' and 'dirspell' in Bash. A suggestion was provided to handle potential errors when setting 'dirspell' on older Bash versions, such as those found on macOS, by redirecting error output to /dev/null.
| shopt -u cdspell | ||
| shopt -u dirspell |
There was a problem hiding this comment.
The dirspell option was introduced in Bash 4.0. On systems with older versions of Bash (such as the default Bash 3.2 on macOS), running shopt -u dirspell will result in an error message like shopt: dirspell: invalid shell option name every time a new shell is opened. To avoid this, you can silence the error output.
| shopt -u cdspell | |
| shopt -u dirspell | |
| shopt -u cdspell dirspell 2>/dev/null |
| fi | ||
|
|
||
| {{ if eq $shell "zsh" }} | ||
| export SPROMPT="Potential spelling error %R , could be %r" |
There was a problem hiding this comment.
@jules this is the correct removal, can we make it conditional if we find "spellcheck" which it seems to be erroring on.
There was a problem hiding this comment.
I've added the spellcheck boolean to .chezmoi.toml.tmpl and made the SPROMPT block conditional on it.
| shopt -s checkwinsize | ||
|
|
||
| # Disable spell check | ||
| shopt -u cdspell |
There was a problem hiding this comment.
@jules this is not necessary atm but we could make it conditional on it's dependencies if there are any
There was a problem hiding this comment.
I've wrapped the shopt -u cdspell and shopt -u dirspell disablements in a check for the spellcheck property.
There was a problem hiding this comment.
I've made the addition of _correct and _approximate to the completion styling conditional, and disabled setting unsetopt correct and unsetopt correct_all to also respect the condition.
Adds a `spellcheck` boolean prompt to `.chezmoi.toml.tmpl` and dynamically adapts Bash and Zsh shell spellcheck/auto-correction features based on this value: - `dot_bash_profile.tmpl`: Conditionally apply `shopt -u cdspell` and `shopt -u dirspell`. - `dot_zshrc.tmpl`: Conditionally enable `_correct` and `_approximate` completers, and apply `unsetopt correct` and `unsetopt correct_all`. - `.chezmoitemplates/prompt.tmpl`: Conditionally export `SPROMPT` based on the config. Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
Disables spellcheck and auto-correction features across Zsh and Bash environments. This resolves the user's issue with shell spellcheck features.
PR created automatically by Jules for task 3406645714609527023 started by @arran4