Skip to content

Clears the terminal, for real. (But probably only on my system.)

License

Notifications You must be signed in to change notification settings

mitranim/emptty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Clears the terminal, for real. (But probably only on my system.)

Why

Googling brings up bizarre advice:

  • Calling a subprocess, when all you needed was to print a few bytes.
  • Scrolling the viewport without clearing the scrollback.

Enough! emptty provides several functions including a "hard clear" that should empty the TTY for real.

Usage

import "github.com/mitranim/emptty"

emptty.ClearHard()

See https://pkg.go.dev/github.com/mitranim/emptty for the full API.

Compatibility

Works on everything I tested:

  • MacOS Terminal.
  • iTerm2.
  • Microsoft Terminal running Ubuntu under WSL.
  • Terminus (Sublime Text plugin).

May or may not work in other emulators.

License

https://unlicense.org

Misc

I'm receptive to suggestions. If this library almost satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts

About

Clears the terminal, for real. (But probably only on my system.)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages