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

[mainloop-] wait less time between quick replay commands #2635 #2635

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions visidata/mainloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,14 @@ def mainloop(vd, scr):
vd.checkForFinishedThreads()
vd.callNoExceptions(sheet.checkCursor)

# no idle redraw unless background threads are running
time.sleep(0) # yield to other threads which may not have started yet
if vd._nextCommands:
if vd.options.replay_wait > 0:
vd.curses_timeout = int(vd.options.replay_wait*1000)
else:
if vd.unfinishedThreads: #2369 #2635
# while running a bg thread for a command, schedule infrequent redraws
vd.curses_timeout = nonidle_timeout
else:
# otherwise, schedule the next redraw and command (immediately, for default replay_wait)
vd.curses_timeout = int(vd.options.replay_wait*1000)
elif vd.unfinishedThreads:
vd.curses_timeout = nonidle_timeout
else:
Expand Down
Loading