forked from ethereum/staking-deposit-cli
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ce2d09
commit 0047d3d
Showing
4 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import subprocess | ||
import sys | ||
import shutil | ||
import click | ||
|
||
|
||
def clear_terminal() -> None: | ||
if sys.platform == 'win32': | ||
try: | ||
subprocess.call('cls', shell=True) | ||
except Exception: | ||
click.clear() | ||
elif sys.platform == 'linux' or sys.platform == 'darwin': | ||
if shutil.which('tput'): | ||
subprocess.call(['tput', 'reset']) | ||
elif shutil.which('reset'): | ||
subprocess.call(['reset']) | ||
elif shutil.which('clear'): | ||
subprocess.call(['clear']) | ||
else: | ||
click.clear() | ||
else: | ||
click.clear() |