Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: -vgprintf: warning: ignoring excess arguments, starting with ‘duration’ #1996

Closed
1 task done
Proteusiq opened this issue May 2, 2024 · 5 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@Proteusiq
Copy link

What did you expect to happen?

Not to see a warning at every command I write

What happened?

I get this message at the end of all my commands: -vgprintf: warning: ignoring excess arguments, starting with ‘duration’

Atuin doctor output

atuin:
  version: 18.2.0
  sync: null
shell:
  name: zsh
  default: zsh
  plugins:
  - atuin
system:
  os: Darwin
  arch: arm64
  version: 14.4.1
  disks:
  - name: Macintosh HD
    filesystem: apfs
  - name: Macintosh HD
    filesystem: apfs

-vgprintf: warning: ignoring excess arguments, starting with ‘duration’

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Proteusiq Proteusiq added the bug Something isn't working label May 2, 2024
@poliorcetics
Copy link
Contributor

Probably coming from

printf -v duration %.0f $(((__atuin_precmd_time - __atuin_preexec_time) * 1000000000))

I'm unsure how that happens though, because testing on the same macOS version with a ZSH doesn't produce this for me and testing doesn't show it:

/bin/zsh -c 'printf -v toto "value = %s" "abc"; echo $toto'

I see a few possibilities:

  1. What does echo $SHELL show ? Can you do $SHELL --version ?
  2. What does which printf return ? For me on macOS with the default ZSH it is printf: shell built-in command

@Proteusiq
Copy link
Author

Logs

echo $SHELL
/bin/zsh
-vgprintf: warning: ignoring excess arguments, starting with ‘duration’

and

$SHELL --version
zsh 5.9 (x86_64-apple-darwin23.0)
-vgprintf: warning: ignoring excess arguments, starting with ‘duration’
❯ which printf
/usr/bin/printf
-vgprintf: warning: ignoring excess arguments, starting with ‘duration’

@poliorcetics
Copy link
Contributor

❯ which printf
/usr/bin/printf

That's not the same result as me, so I would say there is a clue there but I'm confused as to why this would be different.

I don't even get the same error when calling it directly:

> /usr/bin/printf -v duration %.0f 123
/usr/bin/printf: illegal option -- v
usage: printf format [arguments ...]

@Proteusiq
Copy link
Author

Proteusiq commented May 6, 2024

So which I do

❯ /usr/bin/printf -v duration %.0f 123
/usr/bin/printf: illegal option -- v
usage: printf format [arguments ...]

but this cause issues

printf -v duration %.0f 123
-vgprintf: warning: ignoring excess arguments, starting with ‘duration’

while

$(which printf) -v
/usr/bin/printf: illegal option -- v duration %.0f 123
usage: printf format [arguments ...]

So I am not sure why a direct call does not work :)

I tried to alias

alias printf=$(which printf)

Now the error is after each command

❯ ls #mydotfile
alacritty  Brewfile  Brewfile.lock.json  fzf  git  install.sh  LICENSE  macos  nvim  README.md  run.sh  skhd  starship  tmux  vim  vscode  yabai  zsh
/usr/bin/printf: illegal option -- v
usage: printf format [arguments ...]

but

type printf
printf is an alias for gprintf

Could this be an issue?

@Proteusiq
Copy link
Author

unalias to get

type printf
printf is a shell builtin

fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants