You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started customizing the plugin to open in a float as I am improving my workflow with ai. I noticed that I could not set the cursor to stay in my newly opened float because of the setup method. Do you mind if we made it configurable to do so?
Summary
add an optional restore_focus flag to opencode.terminal.setup() while keeping the current behavior as the default
let custom terminal integrations preserve their own focus behavior by calling setup(win, { restore_focus = false })
update the README snacks.terminal example to show how to opt out of the forced focus restore
Why
Custom terminal backends may want to control whether focus stays in the terminal or returns to the previous window. The current setup() helper always restores focus as part of its redraw workaround, which makes it hard for custom integrations to keep the terminal focused.
Thanks for calling this out! I pushed a change just now that moves the redraw workaround to only our terminal implementation, because it seems unnecessary for snacks.terminal. Hopefully that holds true for other terminal integrations too? Let me know if that works for you.
Thanks for calling this out! I pushed a change just now that moves the redraw workaround to only our terminal implementation, because it seems unnecessary for snacks.terminal. Hopefully that holds true for other terminal integrations too? Let me know if that works for you.
Thanks for calling this out! I pushed a change just now that moves the redraw workaround to only our terminal implementation, because it seems unnecessary for snacks.terminal. Hopefully that holds true for other terminal integrations too? Let me know if that works for you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @nickjvandyke!
I started customizing the plugin to open in a float as I am improving my workflow with ai. I noticed that I could not set the cursor to stay in my newly opened float because of the
setupmethod. Do you mind if we made it configurable to do so?Summary
restore_focusflag toopencode.terminal.setup()while keeping the current behavior as the defaultsetup(win, { restore_focus = false })snacks.terminalexample to show how to opt out of the forced focus restoreWhy
Custom terminal backends may want to control whether focus stays in the terminal or returns to the previous window. The current
setup()helper always restores focus as part of its redraw workaround, which makes it hard for custom integrations to keep the terminal focused.