diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a1549e4..c0a0ab62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added `Context.registerClosable` and `Context.callOnClose` to allow you to register cleanup actions that will be called when the command exits. ([#395](https://github.com/ajalt/clikt/issues/395)) ### Fixed +- Fixed `unrecognized modifier 'i'` that happened on tab-completion when using sub command aliases ([#500](https://github.com/ajalt/clikt/pull/500)) - Make sure auto complete script works on zsh, fixing the error `complete:13: command not found: compdef` ([#499](https://github.com/ajalt/clikt/pull/499)) ## 4.2.2 diff --git a/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/completion/BashCompletionGenerator.kt b/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/completion/BashCompletionGenerator.kt index ea3b8825..3034516c 100644 --- a/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/completion/BashCompletionGenerator.kt +++ b/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/completion/BashCompletionGenerator.kt @@ -137,7 +137,7 @@ internal object BashCompletionGenerator { """ | $name) | (( i = i + 1 )) - | COMP_WORDS=( "${'$'}{COMP_WORDS[@]:0:i}" + | COMP_WORDS=( "${'$'}{COMP_WORDS[@]:0:${'$'}{i}}" """.trimMargin() ) toks.joinTo(this, " ", prefix = " ") { "'$it'" }