What can we do for this? https://github.com/mochow13/keen-code/issues/14 Suggest some solutions first that solves the problem but causes the least amount of changes.
So how do we scroll in option 1?
But terminal can support mouse wheel scrolling?
If a terminal supports mouse wheel scrolling and we choose option 1, then it's upto the terminal to support/not support mouse-wheel scrolling?
Let's first Disable mouse capture by default
Ok mouse wheel scrolling is translating to up/down in Ghostty terminal
But this solution is behaving differently in different terminals. And it's also buggy in iterm2.
Discard the current changes.
I think this is our best course of action: Stop relying on alt-screen
I tested it. The content can only be scrolled with page up and down. Though copy paste works.
If we keep streaming messages in bubble tea view and committed messages in scrollback, would it cause issues with the UI, like flickering or so?
How big can it be when streamin in bubble tea?
I am thinking we should perhaps implement our own copy-paste support inside the bubbletea viewport. Does bubbletea not support such a thing?
Ok we shouldn't implement our own copy
We need a long-term solution.
Ok let's work on this. Checkout to a new branch. Then proceed from what you did (git diff)
branch name: feat/scrollback-repl
When I write a message, since live stream is in viewport, a big gap appears first and content gets streamed into it. When finally stream finishes, there are ghost lines and spinner and input text area from the stream hanging.
The gap is still appearing. Now input text area is flickering between bottom and right after the content of the agent messages.
Ok it's not working without bugs.
But if we remove bubble tea, we lose good UI
I found this from Crush, an AI coding agent: https://github.com/charmbracelet/crush/pull/563/changes This MR seems to support text selection. Check.
Ok now I have cloned the crush codebase in ../crush. Check it for the current text selection implementation. This was the previous PR: https://github.com/charmbracelet/crush/pull/563/changes
Ok let's work on this. I have discarded the changes we made.
selecting is automatically copying to clipboard. How can we show a message on the UI that it's copied?
It's getting out of the window if the window width is smaller. Can we show it just above the input text area? We can show it in place of loading text.
Perhaps we don't do it. When users select a section, they only select it. Users then need to use cmd+C or ctrl+c to copy. Let's do that.