2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 03:18:55 +00:00
restic/internal/ui/termstatus
Michael Eischer 5e6af77b7a Unify interactive terminal detection code
Previously the progress bar / status update interval used
stdoutIsTerminal to determine whether it is possible to update the
progress bar or not. However, its implementation differed from the
detection within the backup command which included additional checks to
detect the presence of mintty on Windows. mintty behaves like a terminal
but uses pipes for communication.

This adds stdoutCanUpdateStatus() which calls the same terminal detection
code used by backup. This ensures that all commands consistently switch
between interactive and non-interactive terminal mode.

stdoutIsTerminal() now also returns true whenever stdoutCanUpdateStatus()
does so. This is required to properly handle the special case of mintty.
2021-04-11 20:02:09 +02:00
..
background_linux_test.go Add more error handling 2021-01-30 20:19:47 +01:00
background_linux.go Fix IsProcessBackground on Linux with stdin redirection 2020-10-13 13:12:02 +02:00
background.go Fix IsProcessBackground on Linux with stdin redirection 2020-10-13 13:12:02 +02:00
status_test.go Fix string truncation in ui/termstatus 2020-11-02 12:50:49 +01:00
status.go Unify interactive terminal detection code 2021-04-11 20:02:09 +02:00
terminal_posix.go Rework termstatus 2018-05-07 21:40:07 +02:00
terminal_unix.go Unify interactive terminal detection code 2021-04-11 20:02:09 +02:00
terminal_windows.go Unify interactive terminal detection code 2021-04-11 20:02:09 +02:00