zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.67k stars 1.15k forks source link

When I exit micro, all commands that I typed in cmd dissapear. #2038

Open Aleksit0 opened 3 years ago

Aleksit0 commented 3 years ago

I olen my cmd and type cd, ls, pwd.. I enter micro and after exiting it clears the cmd screen

slangreck commented 2 years ago

I'd like to second this. It doesn't seem to matter which shell you are using (Tested with bash, cmd and powershell, happens everywhere).

After micro is closed, the whole screen is cleared and all previously executed commands are no longer visible.

For me this is the number one thing that keeps me from using micro as my default editor.

Humandoodlebug commented 2 years ago

This seems to depend on the terminal emulator used rather than the shell - I've only managed to reproduce it on windows. What OS/terminal emulator are you using? For reference, it works fine with konsole and in tmux (though they're linux/bsd-only afaik)

slangreck commented 2 years ago

I'm using conhost and Windows Terminal on Windows 10. It is reproducible in those two, but I haven't tested any other terminal emulators

reserschnell commented 1 year ago

For me it's the same issue, I'm working on Windows 10, Windows Terminal and I call micro from Powershell.

HatGuy68 commented 2 months ago

Commenting to check if any progress in this issue? I am also facing the same issue on windows.

dmaluka commented 2 months ago

This is most certainly Windows specific. @JoeKar could you take a look?

JoeKar commented 2 months ago

Yep, I mentioned this here https://github.com/zyedidia/tcell/pull/26 already:

Still something is happening with the terminal style when micro is closed:

  • The Windows Terminal prompt then still uses the background color of micro, till the screen is cleared.
  • The previous history isn't available any longer.

Edit: Maybe it can be solved with gdamores' suggestion instead of mine:

This also uses the alternate screen buffer on Windows by default, with fixes to avoid clearing the non-alternate screen.

A backport of the newer variant is preferable anyway.