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

Progress callback new line for long strings #2109

Closed
pared opened this issue Jun 10, 2019 · 1 comment · Fixed by #2333
Closed

Progress callback new line for long strings #2109

pared opened this issue Jun 10, 2019 · 1 comment · Fixed by #2333
Assignees
Labels
bug Did we break something? ui user interface / interaction

Comments

@pared
Copy link
Contributor

pared commented Jun 10, 2019

Please provide information about your setup
DVC version(i.e. dvc --version), Platform and method of installation (pip, homebrew, pkg Mac, exe (Windows), DEB(Linux), RPM(Linux))

dvc version: 0.41.3
Ubuntu 18.04

When calling ProgressCallback.update() with long string (eg full path of some file) we might encounter situation where instead of caret return progress callback prints to new line.

example:

from dvc.progress import progress, ProgressCallback

l = list(range(10))

pgc = ProgressCallback(len(l))

for i in l:
    import time
    time.sleep(0.5)
    pgc.update("short string {}".format(i))

https://asciinema.org/a/cFIZrki1HjcSZB7O7E6YMamcZ

and when we change displayed string to something longer:

https://asciinema.org/a/jKjtHOBgiLfezKVmrbuTnoNn2

@efiop
Copy link
Contributor

efiop commented Jun 10, 2019

This is the same issue as in #2051 . The solution would be to detect screen size and format(e.g. shorten) accordingly, but I'm not sure that there is a cross-platform way to do that. E.g. if you try wget you'll get the same result.

@casperdcl casperdcl added the ui user interface / interaction label Jul 28, 2019
@casperdcl casperdcl self-assigned this Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something? ui user interface / interaction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants