mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
docs: quote $input in inline command examples
Use echo "$input" instead of echo $input for proper shell variable quoting, consistent with the script file example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5b9c94b436
commit
3aa246a829
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ Add a `statusLine` object under the `ui` key in `~/.qwen/settings.json`:
|
|||
"ui": {
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "input=$(cat); echo \"$(echo $input | jq -r '.model.id') ctx:$(echo $input | jq -r '.context_window.last_prompt_token_count')\"",
|
||||
"command": "input=$(cat); model=$(echo \"$input\" | jq -r '.model.id'); tokens=$(echo \"$input\" | jq -r '.context_window.last_prompt_token_count'); echo \"$model ctx:$tokens\"",
|
||||
"padding": 0
|
||||
}
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ The command receives a JSON object via stdin with the following fields:
|
|||
"ui": {
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "input=$(cat); model=$(echo $input | jq -r '.model.id'); tokens=$(echo $input | jq -r '.context_window.last_prompt_token_count'); size=$(echo $input | jq -r '.context_window.context_window_size'); pct=$((tokens * 100 / (size > 0 ? size : 1))); echo \"$model ctx:${pct}%\""
|
||||
"command": "input=$(cat); model=$(echo \"$input\" | jq -r '.model.id'); tokens=$(echo \"$input\" | jq -r '.context_window.last_prompt_token_count'); size=$(echo \"$input\" | jq -r '.context_window.context_window_size'); pct=$((tokens * 100 / (size > 0 ? size : 1))); echo \"$model ctx:${pct}%\""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue