From e874532b37e8a01adbd0f184b527405fdd36a77a Mon Sep 17 00:00:00 2001 From: Lonny Wong Date: Sun, 17 Jul 2022 22:45:43 +0800 Subject: [PATCH] test and release --- debian/changelog | 6 ++++++ trzsz/progress.go | 8 ++++++++ trzsz/transfer.go | 4 +--- trzsz/version.go | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3601408..5a30d32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +trzsz (0.1.9) trusty; urgency=medium + + * trzsz-go v0.1.9 + + -- Lonny Wong Sun, 17 Jul 2022 08:16:25 +0800 + trzsz (0.1.8) trusty; urgency=medium * Release v0.1.8 with Go1.18. diff --git a/trzsz/progress.go b/trzsz/progress.go index 6fd37a8..d5a3f65 100644 --- a/trzsz/progress.go +++ b/trzsz/progress.go @@ -193,6 +193,14 @@ func (p *TextProgressBar) onStep(step int64) { } func (p *TextProgressBar) onDone() { + if !p.firstWrite { + if p.tmuxPaneColumns > 0 { + p.writer.Write([]byte(fmt.Sprintf("\x1b[%dD", p.columns))) + } else { + p.writer.Write([]byte("\r")) + } + p.firstWrite = true + } } func (p *TextProgressBar) showProgress() { diff --git a/trzsz/transfer.go b/trzsz/transfer.go index 107cbe1..976188a 100644 --- a/trzsz/transfer.go +++ b/trzsz/transfer.go @@ -102,9 +102,7 @@ func (t *TrzszTransfer) stopTransferringFiles() { func (t *TrzszTransfer) cleanInput(timeoutDuration time.Duration) { t.stopped = true t.buffer.drainBuffer() - if atomic.LoadInt64(&t.lastInputTime) == 0 { - return - } + atomic.StoreInt64(&t.lastInputTime, time.Now().UnixMilli()) for { sleepDuration := timeoutDuration - time.Now().Sub(time.UnixMilli(atomic.LoadInt64(&t.lastInputTime))) if sleepDuration <= 0 { diff --git a/trzsz/version.go b/trzsz/version.go index 46475f3..2ce9ba8 100644 --- a/trzsz/version.go +++ b/trzsz/version.go @@ -24,4 +24,4 @@ SOFTWARE. package trzsz -const kTrzszVersion = "0.1.8" +const kTrzszVersion = "0.1.9"