From fd649dbf1223f13ee4fc9ad36ee66e15d1ec096c Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:03:01 +0200 Subject: [PATCH 1/7] Added a note about standard streams while an application is running. Resolves #1017 --- application.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application.go b/application.go index bbd15d2..6e6666b 100644 --- a/application.go +++ b/application.go @@ -250,7 +250,13 @@ func (a *Application) EnablePaste(enable bool) *Application { } // Run starts the application and thus the event loop. This function returns -// when Stop() was called. +// when [Application.Stop] was called. +// +// Note that while an application is running, it fully claims stdin, stdout, and +// stderr. If you use these standard streams, they may not work as expected. +// Consider stopping the application first or suspending it (using +// [Application.Suspend]) if you have to interact with the standard streams, for +// example when needing to print a call stack during a panic. func (a *Application) Run() error { var ( err, appErr error From 520ccd71f0785637427f78f42e3333eb253bfa7f Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:12:17 +0200 Subject: [PATCH 2/7] Focus on text area in input field will trigger input field's focus callback. #1020 --- inputfield.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inputfield.go b/inputfield.go index 27b74bc..0541130 100644 --- a/inputfield.go +++ b/inputfield.go @@ -135,6 +135,11 @@ func NewInputField() *InputField { if i.changed != nil { i.changed(i.textArea.GetText()) } + }).SetFocusFunc(func() { + // Forward focus event to the input field. + if i.Box.focus != nil { + i.Box.focus() + } }) i.textArea.textStyle = tcell.StyleDefault.Background(Styles.ContrastBackgroundColor).Foreground(Styles.PrimaryTextColor) i.textArea.placeholderStyle = tcell.StyleDefault.Background(Styles.ContrastBackgroundColor).Foreground(Styles.ContrastSecondaryTextColor) From 1ad6daede22e7bfccb0b4631bc575abf85c98010 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:32:33 +0200 Subject: [PATCH 3/7] Text area has default size to avoid issues before first Draw. Fixes #1025 --- textarea.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/textarea.go b/textarea.go index 842fad0..bdee098 100644 --- a/textarea.go +++ b/textarea.go @@ -1,6 +1,7 @@ package tview import ( + "math" "strings" "unicode" "unicode/utf8" @@ -363,6 +364,8 @@ func NewTextArea() *TextArea { lastAction: taActionOther, minCursorPrefix: minCursorPrefixDefault, minCursorSuffix: minCursorSuffixDefault, + lastWidth: math.MaxInt / 2, // We need this so some functions work before the first draw. + lastHeight: 1, } t.editText.Grow(editBufferMinCap) t.spans[0] = textAreaSpan{previous: -1, next: 1} From a64fc48d7654432f71922c8b908280cdb525805c Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 21 Sep 2024 14:24:03 +0200 Subject: [PATCH 4/7] Temporary dropdown colour fix. Resolves #1026 --- dropdown.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dropdown.go b/dropdown.go index 3bef0ac..3808067 100644 --- a/dropdown.go +++ b/dropdown.go @@ -380,9 +380,6 @@ func (d *DropDown) Draw(screen tcell.Screen) { fieldWidth = rightLimit - x } fieldStyle := tcell.StyleDefault.Background(d.fieldBackgroundColor) - if d.HasFocus() && !d.open { - fieldStyle = fieldStyle.Background(d.fieldTextColor) - } if d.disabled { fieldStyle = fieldStyle.Background(d.backgroundColor) } @@ -408,9 +405,6 @@ func (d *DropDown) Draw(screen tcell.Screen) { text = d.currentOptionPrefix + d.options[d.currentOption].Text + d.currentOptionSuffix } // Just show the current selection. - if d.HasFocus() && !d.open && !d.disabled { - color = d.fieldBackgroundColor - } Print(screen, text, x, y, fieldWidth, AlignLeft, color) } From c06c91881940a1404d591d7a74419eef41f51299 Mon Sep 17 00:00:00 2001 From: Markus Ressel Date: Sun, 13 Oct 2024 13:49:34 +0200 Subject: [PATCH 5/7] Add fan2go-tui to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3a4e352..1f9bffe 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ For a presentation highlighting this package, compile and run the program found - [DBee: Simple database browser](https://github.com/murat-cileli/dbee) - [oddshub: A TUI for sports betting odds](https://github.com/dos-2/oddshub) - [envolve: Terminal based interactive app for manage enviroment variables](https://github.com/erdemkosk/envolve) +- [fan2go-tui: Terminal UI for fan2go](https://github.com/markusressel/fan2go-tui) ## Documentation From a02b962ec68b0d0952ed9a48419ce82045014e84 Mon Sep 17 00:00:00 2001 From: Markus Ressel Date: Sun, 13 Oct 2024 13:52:11 +0200 Subject: [PATCH 6/7] Add zfs-file-history to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3a4e352..1871674 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ For a presentation highlighting this package, compile and run the program found - [DBee: Simple database browser](https://github.com/murat-cileli/dbee) - [oddshub: A TUI for sports betting odds](https://github.com/dos-2/oddshub) - [envolve: Terminal based interactive app for manage enviroment variables](https://github.com/erdemkosk/envolve) +- [zfs-file-history: Terminal UI for inspecting and restoring file history on ZFS snapshots](https://github.com/markusressel/zfs-file-history) ## Documentation From 5e1f9bd501a95e40114774a6b4e2896b0d5072b4 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Mon, 14 Oct 2024 07:00:14 -0400 Subject: [PATCH 7/7] Remove abandoned project from readme --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 3a4e352..d2bde4b 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ For a presentation highlighting this package, compile and run the program found - [Test your typing speed in the terminal!](https://github.com/shilangyu/typer-go) - [TUI Client for Docker](https://github.com/skanehira/docui) - [SSH client using certificates signed by HashiCorp Vault](https://github.com/stephane-martin/vssh) -- [A go terminal based pos software.](https://github.com/thebmw/y2kpos) - [VMware vCenter Text UI](https://github.com/thebsdbox/vctui) - [Bookmarks on terminal](https://github.com/tryffel/bookmarker) - [A UDP testing utility](https://github.com/vaelen/udp-tester)