[GH-ISSUE #545] Mouse binding is not working after resuming back from Application.Suspend() #397

Closed
opened 2026-03-04 01:04:38 +03:00 by kerem · 2 comments
Owner

Originally created by @ajaxray on GitHub (Jan 8, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/545

Hello folks,
Need your kind help for geek-life, a CLI To-Do List Manager.

I am trying to edit some content (task detail) using external editor.
So, I am doing this:

  • Writing the content in a temporary file
  • Using Application.Suspend() for opening the temporary file in vim (or $EDITOR from env)
  • On Save and Exit of editor, reading back the tmp file content
app.Suspend(func() {
    // Opening a tmp file in external editor
    // Reading tmp file content after returning back
})
// ... 
app.EnableMouse(true)

You may check actual code here.

It's working as expected and the new content is being saved.
But the problem is, Mouse bindings are no more working after resuming application.
Even calling app.EnableMouse(true) manually after Suspend is not working. :(

Any support/clue is very much appreciated. Thanks!

Originally created by @ajaxray on GitHub (Jan 8, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/545 Hello folks, Need your kind help for [geek-life](https://github.com/ajaxray/geek-life), a CLI To-Do List Manager. I am trying to edit some content (task detail) using external editor. So, I am doing this: - Writing the content in a temporary file - Using `Application.Suspend()` for opening the temporary file in vim (or `$EDITOR` from env) - On Save and Exit of editor, reading back the tmp file content ``` app.Suspend(func() { // Opening a tmp file in external editor // Reading tmp file content after returning back }) // ... app.EnableMouse(true) ``` You may check actual code [here](https://github.com/ajaxray/geek-life/blob/master/app/task_detail.go#L236). It's working as expected and the new content is being saved. But the problem is, Mouse bindings are no more working after resuming application. Even calling `app.EnableMouse(true)` manually after Suspend is not working. :( Any support/clue is very much appreciated. Thanks!
kerem closed this issue 2026-03-04 01:04:38 +03:00
Author
Owner

@rivo commented on GitHub (Jan 11, 2021):

Thanks for noticing this. The tcell.Screen object is replaced after the Suspend() function returns but I forgot to enable the mouse on that new object. This should be fixed now.

<!-- gh-comment-id:758113703 --> @rivo commented on GitHub (Jan 11, 2021): Thanks for noticing this. The `tcell.Screen` object is replaced after the `Suspend()` function returns but I forgot to enable the mouse on that new object. This should be fixed now.
Author
Owner

@ajaxray commented on GitHub (Jan 15, 2021):

@rivo Thanks a lot!
The issue is now fixed after updating.

<!-- gh-comment-id:760659429 --> @ajaxray commented on GitHub (Jan 15, 2021): @rivo Thanks a lot! The issue is now fixed after updating.
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#397
No description provided.