[GH-ISSUE #476] Application colors changed after using app.Suspend() to call Neovim #345

Closed
opened 2026-03-04 01:04:11 +03:00 by kerem · 3 comments
Owner

Originally created by @khughitt on GitHub (Jul 19, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/476

Greetings!

Apologies for the barrage of issues over the past few days.. 😅

One more issue I noticed that I thought I would report is a change colors after using Suspend() to temporarily launch a Vim/Neovim instance:

tview_suspend_color_change_2020-07-19

The above video shows the issue for both Vim/Neovim.

To Reproduce

package main

import (
    "os"
    "os/exec"
	"github.com/rivo/tview"
)

func main() {
    app := tview.NewApplication()

    form := tview.NewForm().
        AddButton("Launch Neovim", func() {
            app.Suspend(func() {
                cmd := exec.Command("nvim", "/tmp/foo")
                cmd.Stdout = os.Stdout
                cmd.Stdin = os.Stdin
                cmd.Run()
            })
        }).AddButton("Exit", func() {
            app.Stop()
        })

    form.SetBorder(true)

	if err := app.SetRoot(form, true).SetFocus(form).Run(); err != nil {
		panic(err)
	}

}

In a separate application where I am using go-term-markdown to render a markdown document inside a grid element, the effect is even more pronounced.

There, the background color for all "blank space" areas in between text changes to black, which starkly contrasts against the grey background in areas where this is text, resulting in an uneven "striped" pattern.

In both cases, it seems like after exiting Nvim/Vim and returning to tview, the original true colors are swapped for something like 256-bit color equivalents.

Any ideas what could be causing the issue / if there is any way to workaround this?

Any advice would be greatly appreciated!

System Info

  • Arch Linux 5.7.7 64-bit
  • Go 1.14.5
  • Termite
Originally created by @khughitt on GitHub (Jul 19, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/476 Greetings! Apologies for the barrage of issues over the past few days.. :sweat_smile: One more issue I noticed that I thought I would report is a change colors after using `Suspend()` to temporarily launch a Vim/Neovim instance: ![tview_suspend_color_change_2020-07-19](https://user-images.githubusercontent.com/125001/87875047-6da78e00-c99c-11ea-83c9-38d5ec172326.gif) The above video shows the issue for both Vim/Neovim. **To Reproduce** ```go package main import ( "os" "os/exec" "github.com/rivo/tview" ) func main() { app := tview.NewApplication() form := tview.NewForm(). AddButton("Launch Neovim", func() { app.Suspend(func() { cmd := exec.Command("nvim", "/tmp/foo") cmd.Stdout = os.Stdout cmd.Stdin = os.Stdin cmd.Run() }) }).AddButton("Exit", func() { app.Stop() }) form.SetBorder(true) if err := app.SetRoot(form, true).SetFocus(form).Run(); err != nil { panic(err) } } ``` In a separate application where I am using [go-term-markdown](github.com/MichaelMure/go-term-markdown) to render a markdown document inside a grid element, the effect is even more pronounced. There, the background color for all "blank space" areas in between text changes to black, which starkly contrasts against the grey background in areas where this is text, resulting in an uneven "striped" pattern. In both cases, it seems like after exiting Nvim/Vim and returning to tview, the original true colors are swapped for something like 256-bit color equivalents. Any ideas what could be causing the issue / if there is any way to workaround this? Any advice would be greatly appreciated! **System Info** - Arch Linux 5.7.7 64-bit - Go 1.14.5 - [Termite](https://github.com/thestinger/termite)
kerem closed this issue 2026-03-04 01:04:11 +03:00
Author
Owner

@rivo commented on GitHub (Sep 15, 2020):

I don't know what's causing this. It's also beyond the scope of tview. You may want to get in touch with the maintainer of tcell (@gdamore) and ask how running a different application inbetween tcell sessions (which tview is built upon) affects terminal colours.

<!-- gh-comment-id:692667110 --> @rivo commented on GitHub (Sep 15, 2020): I don't know what's causing this. It's also beyond the scope of `tview`. You may want to get in touch with the maintainer of [`tcell`](https://github.com/gdamore/tcell) (@gdamore) and ask how running a different application inbetween `tcell` sessions (which `tview` is built upon) affects terminal colours.
Author
Owner

@gdamore commented on GitHub (Sep 15, 2020):

There have been API improvements in tcell v2 which should help here.

<!-- gh-comment-id:692723651 --> @gdamore commented on GitHub (Sep 15, 2020): There have been API improvements in tcell v2 which should help here.
Author
Owner

@khughitt commented on GitHub (Sep 15, 2020):

Okay great! I'll keep an eye out for that. Just let me know if you would like any help with testing.

<!-- gh-comment-id:692863889 --> @khughitt commented on GitHub (Sep 15, 2020): Okay great! I'll keep an eye out for that. Just let me know if you would like any help with testing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#345
No description provided.