Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should clear any terminal output when done #8

Open
gavinwahl opened this issue Jan 1, 2013 · 0 comments
Open

Should clear any terminal output when done #8

gavinwahl opened this issue Jan 1, 2013 · 0 comments

Comments

@gavinwahl
Copy link
Owner

Before sdb exits, it should [optionally?] clear all of its output from the terminal.

This function can be used:

def clearlines(n=1):
    """
    Clear the past n lines from the terminal

    http://ascii-table.com/ansi-escape-sequences-vt-100.php
    """
    sys.stdout.write("\033[%sA" % n)  # move cursor up n lines
    sys.stdout.write("\033[J")  # clear screen from cursor down

It works in xterm and urxvt, at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant