Skip to content

forest-cli snapshot export bugs up the terminal #3171

Closed

Description

@jdjaustin

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Run forest
  2. Run forest-cli snapshot export in another terminal window
  3. Upon successful export, the export path is displayed in the format Snapshot located at <PATH>. In MacOS, the terminal displays a garbage % at the end of this path and properly displays the terminal prompt in a new line. In Ubuntu (in a droplet's GUI with a fresh install of both rustup and Forest), the export path collides with the new terminal prompt (which is not displayed on a new line). In both OSes, resizing the terminal window after export results in garbage duplication of characters. While not certain that this is related to the progress bar, resizing the terminal window during snapshot export also results in both duplication of the progress bar and random garbage (duplicated characters) displayed in the terminal.

Log output

Log Output
paste log output...

Expected behaviour

Snapshot export completes successfully, reports status with export path, and restores terminal prompt in a new line with no buggy behavior.

Screenshots

Environment (please complete the following information):

  • OS:
  • Rust version(e.g. rustc --version)
  • Branch/commit

Other information and links

Screen Shot 2023-07-11 at 6 37 30 PM Screen Shot 2023-07-11 at 6 37 04 PM

Activity

  1. lemmih commented on Jul 12, 2023

    @lemmih
    Contributor

    Relevant code:

    bar.lock().await.finish_println(&format!(
    "Export completed. Snapshot located at {}",
    out.display()
    ));

    The naming is somewhat confusing but finish_println does not print a newline at the end of the string. It prints a newline before the string. We either add a newline at the end or switch to indicatif. @jdjaustin, how about you add the newline?

  2. jdjaustin commented on Jul 14, 2023

    @jdjaustin
    ContributorAuthor

    Adding the newline resolved the issue with the garbled output after snapshot export, but the issue with resizing the window while displaying a progress bar remained, and using indicatif did not fix that either. However, this issue also occurs during snapshot import in both Forest and Lotus, and it appears to be a fairly commonly reported problem among other terminal apps, so I think we can close this issue with the newline fix.

  3. lemmih commented on Jul 14, 2023

    @lemmih
    Contributor

    Adding the newline resolved the issue with the garbled output after snapshot export, but the issue with resizing the window while displaying a progress bar remained, and using indicatif did not fix that either. However, this issue also occurs during snapshot import in both Forest and Lotus, and it appears to be a fairly commonly reported problem among other terminal apps, so I think we can close this issue with the newline fix.

    Right, that's just how terminals are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions