bash: __bp_last_argument_prev_command: parameter null or not set #56
-
Checks
Expected behaviourThere is some weird interaction between Code Whisperer and Bash completion for commands like " If I disable CW (by commenting out both the pre block and post block in my The only reference I found online related to the variable Actual behaviourSee keypress-by-keypress descriptions below. Steps to reproduceSome examples: # no problem
$ nats<return>
usage: nats [<flags>] <command> [<args> ...]
...
# no problem
$ nats<tab><space-inserted> <return>
usage: nats [<flags>] <command> [<args> ...]
# bug appears
$ nats<tab><space-inserted> <tab><no-changes><return>
bash: __bp_last_argument_prev_command: parameter null or not set
usage: nats [<flags>] <command> [<args> ...]
...
# bug appears
$ nats cont<tab><subcommand-completed>ext<space-inserted> <return>
bash: __bp_last_argument_prev_command: parameter null or not set
error: a subcommand from the list below is required, use --help for full help including flags and arguments
...error expected...
# bug appears
$ nats cont<tab><subcommand-completed>ext<space-inserted> ls<return>
bash: __bp_last_argument_prev_command: parameter null or not set
...table output... EnvironmentCODEWHISPERER-details:
- 0.13.0
hardware-info:
- model:
- model-id:
- chip-id: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
- cores: 8
- mem: 64.00 GB
os-info:
- macOS 14.2.1 (23C71)
environment:
- shell: /usr/local/Cellar/bash/5.2.21/bin/bash
- terminal: iterm
- cwd: /Users/erhhung
- exe-path: /Users/erhhung/.local/bin/cw
- install-method: unknown
- env-vars:
- SHELL: /usr/local/bin/bash
- CWTERM_SESSION_ID: 0c1da728a5fe4a2bb2cbc501344b7b05
- __CFBundleIdentifier: com.googlecode.iterm2
- TERM: xterm-256color
- DISPLAY: :0.0
- CW_TERM: 0.13.0
- CW_SET_PARENT_CHECK: 1
- PATH: /Users/erhhung/.local/bin:/Users/erhhung/.krew/bin:/Users/erhhung/.go/bin:/Users/erhhung/.pyenv/shims:/usr/local/opt/tcl-tk/bin:/usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home/bin:/Users/erhhung/.perl5/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/erhhung/.local/bin:/opt/confluent/bin |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Figured out the issue I was having, which was caused by me messing around with the important # CodeWhisperer pre block. Keep at the top of this file.
[[ -f "${HOME}/Library/Application Support/codewhisperer/shell/bash_profile.pre.bash" ]] && builtin source "${HOME}/Library/Application Support/codewhisperer/shell/bash_profile.pre.bash"
_bash_history_sync() {
builtin history -a
}
# DON'T JUST REPLACE PROMPT_COMMAND
PROMPT_COMMAND="_bash_history_sync" Always append to existing if [[ "$PROMPT_COMMAND" != *_bash_history_sync* ]]; then
PROMPT_COMMAND="_bash_history_sync; $PROMPT_COMMAND"
fi |
Beta Was this translation helpful? Give feedback.
Figured out the issue I was having, which was caused by me messing around with the important
$PROMPT_COMMAND
environment variable inside my "~/.bash_profile
" after the CodeWhisperer pre block:Always append to existing
$PROMPT_COMMAND
: