mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
fix(history): handle HIST_STAMPS with whitespace in timestamp format
Correctly handle whitespace in custom history timestamp formats. Fixes an issue where spaces in HIST_STAMPS (e.g., "%y-%m-%d %T") caused errors by ensuring proper quoting when passing the format to `fc`. This resolves unintended parsing of timestamp components as invalid event specifiers. Closes #12365.
This commit is contained in:
parent
f6a7bbf81a
commit
53c1a451c9
1 changed files with 2 additions and 2 deletions
|
|
@ -18,10 +18,10 @@ function omz_history {
|
|||
print -u2 History file deleted.
|
||||
elif [[ $# -eq 0 ]]; then
|
||||
# if no arguments provided, show full history starting from 1
|
||||
builtin fc $stamp -l 1
|
||||
builtin fc "${stamp[@]}" -l 1
|
||||
else
|
||||
# otherwise, run `fc -l` with a custom format
|
||||
builtin fc $stamp -l "$@"
|
||||
builtin fc "${stamp[@]}" -l "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue