Skip to content

Comments

Flag to clear the terminal before outputting text#12

Open
solarisfire wants to merge 2 commits intojrnxf:mainfrom
solarisfire:main
Open

Flag to clear the terminal before outputting text#12
solarisfire wants to merge 2 commits intojrnxf:mainfrom
solarisfire:main

Conversation

@solarisfire
Copy link

What: Addition of a clear screen flag (-w for wipe) which does a simple clear of the terminal before outputting stylized text.

Why: I hve text flowing out of a program that I was piping to fsrx, that left a bunch of output above the text I was trying to read and I found this fatiguing. Clearing the screen makes for a nicer reading experience, but I couldn't find an elegant way to do this without writing the text to a file, clearing the screen, then using fsrx to read the file.

How: Addition of the wipe flag as a simple boolean, simple if statement within the main function, if set it then runs print!("\x1B[2J\x1B[1;1H"); which seems to be the lightest weight way to clear the terminal nicely.

Checklist:

  • Allow edits from maintainers option checked
  • Branch name is prefixed with [your_username]/ (ex. thatvegandev/featureX)
  • Documentation added
  • Tests added N/A - I don't see any current test units
  • No failing actions
  • Merge ready

    It's such a small change that I believe it should be fine.

First time ever working with Rust, so I'm a complete newbie... So please educate me if I've done anything stupid!

…g any content. Useful when piping text to the command and wanting a clean slate to read from.
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

Successfully merging this pull request may close these issues.

1 participant