Skip to content

feat(bash): support high-resolution timing even without ble.sh #1534

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

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

akinomyoga
Copy link
Contributor

I decided to provide the timing with EPOCHREALTIME even without ble.sh. It is not as accurate in the case with ble.sh, but we may still support it in the same way as done in the Zsh integration.

I also would like to add a fix to the previous PR. I haven't carefully thought about the interference with a custom IFS possibly set by users. When the user have a custom IFS, the constructs ${duration:+--duration "$duration"} might unexpectedly split by the word splitting. In this patch, we use the form --duration=$duration and properly quote it to prevent it from being split.

Copy link

vercel bot commented Jan 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
atuin-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2024 10:58pm

For the integration using bash-preexec, this measures the execution
time of the command using EPOCHREALTIME without the support by ble.sh.
This is not as accurate as the measurement by ble.sh as it contains
also the processing time of the preexec and precmd hooks, but it is
still free from the fork cost.
When a custom IFS is set by the user, the word splitting of
${duration:+--duration "$duration"} does not work as expected.  We
instead use the form "--duration=$duration" with the word splitting
being disabled.
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@ellie ellie enabled auto-merge (squash) January 10, 2024 13:22
@ellie ellie merged commit 99f76ce into atuinsh:main Jan 10, 2024
@akinomyoga akinomyoga deleted the bash-EPOCHREALTIME branch January 10, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants