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'm doing a simple thing that allows one to select a git commit from a list, and then launch a diff tool to show it.
For context, in the past this has been a shell one-liner: git log --since 1day --format=format:%H | xargs -I % sh -c 'git show % | delta --paging always', there we could move to next commit by closing delta, but there was no way of browsing back, thus bubbletea.
This is all cobbled together from the tutorial and the exec/altscreen examples, but changing the openEditor function to:
I have a hard-coded list of commits SHAs in the initial model. When I pick a commit from the list and pass it into a tea.ExecProcess, for a few milliseconds I see the diff of the previous commit (or my terminal as it was before starting the bbt process if this is the first commit being picked) before the content is updated with the correct content. I've tried playing around with returning a tea.Sequence(tea.ClearScreen, diffCmd) but that had no observable impact.
Any ideas how I could get it to not show the wrong output when running ExecProcess? I would be entirely happy even with a blank screen while it's waiting for the output of the process being run, but showing the previous diff makes for a jarring experience.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm doing a simple thing that allows one to select a git commit from a list, and then launch a diff tool to show it.
For context, in the past this has been a shell one-liner:
git log --since 1day --format=format:%H | xargs -I % sh -c 'git show % | delta --paging always'
, there we could move to next commit by closing delta, but there was no way of browsing back, thus bubbletea.This is all cobbled together from the tutorial and the exec/altscreen examples, but changing the
openEditor
function to:I have a hard-coded list of commits SHAs in the initial model. When I pick a commit from the list and pass it into a
tea.ExecProcess
, for a few milliseconds I see the diff of the previous commit (or my terminal as it was before starting the bbt process if this is the first commit being picked) before the content is updated with the correct content. I've tried playing around with returning atea.Sequence(tea.ClearScreen, diffCmd)
but that had no observable impact.Any ideas how I could get it to not show the wrong output when running
ExecProcess
? I would be entirely happy even with a blank screen while it's waiting for the output of the process being run, but showing the previous diff makes for a jarring experience.Beta Was this translation helpful? Give feedback.
All reactions