Skip to content

bug report: CLEAR_SCREEN is not portable #68

@PiprTuff

Description

@PiprTuff

Current implementation of the CLEAR_SCREEN command returns only \033[2J which works on Windows but on not in many other modern terminals.

Most of the terminals used today are VT terminals, which includes most of the modern Linux and Mac terminals and the Windows Terminal available since Windows 10+. The escape sequence for clearing the screen and the scroll-back in a VT terminal is \033c. This should also work in the Windows Command Prompt if VT (support for ANSI) is enabled. This works exactly like calling clear in Linux or cls in Windows.

Some other Linux terminals, like the KDE Console (Konsole) and XTerm support \033[3J for clearing the screen and resetting the scroll-back.

In my opinion, \033c will be the most platform-independent implementation. But users should be able to provide custom escape sequence implementation for the CLEAR_SCREEN command.

Source: https://stackoverflow.com/a/5367075

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions