micro icon indicating copy to clipboard operation
micro copied to clipboard

On Windows, exiting the program erases the scrollback buffer

Open garoto opened this issue 10 months ago • 3 comments

Description of the problem or steps to reproduce

micro will erase the scrollback buffer upon exit.

Specifications

Commit hash: 98356765 OS: Windows 10 21H2 Terminal: WindowsTerminal.exe canary, openconsole.exe canary , cmd.exe 21h2 native.

This is a deal-braker to me. Anyway to make it stop doing it? Maybe a envvar? Or is this a tcell behavior?

garoto avatar Apr 04 '25 21:04 garoto

This is an issue that only occurs with the old fork of Tcell that Micro uses. It is reported in #1243 and #2038 so this could be closed as a duplicate, but other issues seem to be currently focused.

This issue has also bothered me when I use Micro on Windows. The only good thing I could say is that I have started thinking on how to update the fork, so that platform-specific fixes (not only on Windows) could be applied.

niten94 avatar Apr 04 '25 23:04 niten94

Nice, thanks for linking those issues. I searched for "scrollback", "scrollback buffer" but nothing relevant came up. Oh well.

While I was typing this, I think I managed to find a workaround: explicitly running the program in an alternate screen buffer and returning after:

C:\> busybox printf \x1b[?1049h & micro test.txt & busybox printf \x1b[?1049l

Goint to try and make a doskey macro with this CLI and see how it goes!

garoto avatar Apr 05 '25 01:04 garoto

The only good thing I could say is that I have started thinking on how to update the fork, so that platform-specific fixes (not only on Windows) could be applied.

The first foundation is build with the master branch of tcell in the micro-editor organization. Unfortunately a lot more changes done at the legacy branch must be ported to the much newer upstream code base, for which I wasn't able to spend the time yet.

JoeKar avatar Apr 05 '25 11:04 JoeKar