aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-04-13 00:37:39 +0200
committerRobin Jarry <robin@jarry.cc>2024-04-13 21:47:50 +0200
commit535e7fe3aa50dc56af6449673d13ca0c0ac4e961 (patch)
tree38e2ec1b4bc28cf7c880227b892dced16c9680c2 /lib
parent9849601906f3d53e38321e4b3a4461f60520bbca (diff)
downloadaerc-535e7fe3aa50dc56af6449673d13ca0c0ac4e961.tar.gz
vaxis: fix panic trace print on stderr
By default, vaxis tries to open stderr, stdout and stdin in that order and uses the first one as its TTY file descriptor. Upon exit, vaxis.Close() closes that file descriptor. When aerc panics, our panic handler calls UICleanup() which is an alias for vaxis.Close(). This effectively makes os.Stderr unusable and all error messages are written to a closed file descriptor. This also break the regular go runtime panic() handler which prints on stderr as well. Use an explicit /dev/tty path instead of stderr to keep it open. Fixes: 6eff242090dc ("ui: so long tcell") Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ui/ui.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index 8cc797b2..0825b5b5 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -51,6 +51,7 @@ func Initialize(content DrawableInteractive) error {
opts := vaxis.Options{
DisableMouse: !config.Ui.MouseEnabled,
CSIuBitMask: vaxis.CSIuDisambiguate,
+ WithTTY: "/dev/tty",
}
vx, err := vaxis.New(opts)
if err != nil {