https://github.com/mitranim/emptty
Clears the terminal, for real. (But probably only on my system.)
https://github.com/mitranim/emptty
clearing golang terminal tty
Last synced: 3 months ago
JSON representation
Clears the terminal, for real. (But probably only on my system.)
- Host: GitHub
- URL: https://github.com/mitranim/emptty
- Owner: mitranim
- License: unlicense
- Created: 2021-02-07T13:22:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T13:25:45.000Z (over 4 years ago)
- Last Synced: 2025-02-24T06:44:38.322Z (3 months ago)
- Topics: clearing, golang, terminal, tty
- Language: Go
- Homepage:
- Size: 1000 Bytes
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## 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
```go
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