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

dots-v2 is jittery #352

Closed
howardjohn opened this issue Aug 9, 2023 · 3 comments · Fixed by #368
Closed

dots-v2 is jittery #352

howardjohn opened this issue Aug 9, 2023 · 3 comments · Fixed by #368
Labels
bug Something isn't working

Comments

@howardjohn
Copy link
Contributor

Using dots-v2 is very jittery/jumpy. Its harder to describe than to show:

https://asciinema.org/a/qeanwygqDJaXp6KcpWhfCOQQs

OR

cast.txt

The upload shows it a bit but not the worst part, as it gets worse as more tests are completed - but there is a size limit I was running into. To run the cast.txt do asciinema play cast.txt.

Recording was on linux alacritty. I also did gnome terminal and saw similar.

I am planning to do a bit more investigation into this, but figured i would open the issue in the meantime

howardjohn added a commit to howardjohn/gotestsum that referenced this issue Aug 9, 2023
howardjohn added a commit to howardjohn/gotestsum that referenced this issue Aug 10, 2023
Contributes to gotestyourself#352

Currently, as the new screen is written the cursor jumps around the
terminal. This hides it, writes everything else, then returns it.

Prior art:
https://github.com/docker/compose/blob/80856eacafcf96d6f27e74c07e42386fe662f8ef/pkg/progress/tty.go#L160-L162
howardjohn added a commit to howardjohn/gotestsum that referenced this issue Aug 10, 2023
Contributes to gotestyourself#352

Currently, as the new screen is written the cursor jumps around the
terminal. This hides it, writes everything else, then returns it.

Prior art:
https://github.com/docker/compose/blob/80856eacafcf96d6f27e74c07e42386fe662f8ef/pkg/progress/tty.go#L160-L162

(cherry picked from commit 77cd725)
@dnephin dnephin added the bug Something isn't working label Aug 12, 2023
howardjohn added a commit to howardjohn/gotestsum that referenced this issue Aug 15, 2023
@howardjohn
Copy link
Contributor Author

howardjohn commented Sep 7, 2023

Some of this is from tmux and/or alacritty I think as well.

Simple test to see if blinking is caused by terminal:

function clear() {
  echo -en "\e[${1}A\e[0J"
}
function write() {
  yes "$1" | head -n "$2"
}

n=40
echo -e "\n\n\n\n"
for i in {0..25}; do
  echo -en '\e[?25l'
  clear $n
  write "`seq 0 25 | xargs`" $n
  echo -en '\e[?25h'
  sleep .1
done

@howardjohn
Copy link
Contributor Author

There is a semi-standard escape sequence to 'batch' a write. Example:

echo -en "\eP=1s\e\x5c"; echo foo; sleep .1; echo bar;  echo -en "\eP=2s\e\x5c"

Will write foo and bar in one go. Its not supported in tmux, though, as far as I can tell

@howardjohn
Copy link
Contributor Author

Aha. I found the last piece of the puzzle. We don't need complex terminal features, we just need to stop doing clear all; write all and instead do it line-by-line. This way each cell never goes from text -> blank -> text. Pretty simple change, I will send a PR in a bit

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

Successfully merging a pull request may close this issue.

2 participants