-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(config): add refresh interval for periodic prompt updates #6938
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
base: main
Are you sure you want to change the base?
Changes from 13 commits
03d5b6a
a0ca87a
4e1e72c
72079c3
b267bd8
81be569
1c398cf
fee5e77
777c65d
a4a1baf
9dd103d
7ce711c
91e4205
4797c37
47a41c0
fa44e3b
af8d69f
6f7850e
c3472ea
7aee74e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -161,4 +161,34 @@ function _omp_install_hook() { | |||
| PROMPT_COMMAND=(_omp_hook "${prompt_command[@]}") | ||||
| } | ||||
|
|
||||
| function enable_posh_refresh_interval() { | ||||
| local interval=::REFRESH_INTERVAL:: | ||||
| if [[ $interval -le 0 ]]; then | ||||
| return | ||||
| fi | ||||
|
|
||||
| # Convert milliseconds to seconds for bash (preserve sub-second precision) | ||||
| local timeout_seconds=$(awk "BEGIN {print $interval/1000}") | ||||
|
|
||||
| function _omp_refresh_prompt() { | ||||
| # Trigger prompt refresh by calling the hook | ||||
| _omp_hook | ||||
| } | ||||
|
|
||||
| # Use a background process with sleep to trigger refresh | ||||
| parent_pid=$$ | ||||
sanki92 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| ( | ||||
| while true; do | ||||
| sleep "$timeout_seconds" | ||||
| kill -WINCH $parent_pid 2>/dev/null | ||||
sanki92 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| done | ||||
| ) & | ||||
sanki92 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
|
||||
|
||||
sanki92 marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -235,6 +235,30 @@ bind \cc _omp_ctrl_c_key_handler -M default | |||||||||||||||||||
| bind \cc _omp_ctrl_c_key_handler -M insert | ||||||||||||||||||||
| bind \cc _omp_ctrl_c_key_handler -M visual | ||||||||||||||||||||
|
|
||||||||||||||||||||
| function enable_posh_refresh_interval | ||||||||||||||||||||
| set --local interval ::REFRESH_INTERVAL:: | ||||||||||||||||||||
| if test $interval -le 0 | ||||||||||||||||||||
| return | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Convert milliseconds to seconds for fish | ||||||||||||||||||||
| set --local timeout_seconds (math "$interval / 1000.0") | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
||||||||||||||||||||
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected on line 250. This should be removed for consistency with coding standards.
| function _omp_refresh_timer --on-signal SIGUSR1 | |
| omp_repaint_prompt | |
| end | |
| function _omp_refresh_timer --on-signal SIGUSR1 | |
| omp_repaint_prompt | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected on line 178. This should be removed for consistency with coding standards.