| delorie.com/archives/browse.cgi | search |
| Message-ID: | <38742647.DDFA40BB@imrworldwide.com> |
| From: | Colin Forster <colin AT imrworldwide DOT com> |
| X-Mailer: | Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.7-RELEASE i386) |
| MIME-Version: | 1.0 |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: clear screen in bash ? |
| References: | <200001051525 DOT JAA17915 AT darwin DOT sfbr DOT org> |
| Lines: | 48 |
| Date: | Thu, 06 Jan 2000 16:21:12 +1100 |
| NNTP-Posting-Host: | 203.36.43.136 |
| X-Complaints-To: | abuse AT telstra DOT net |
| X-Trace: | nsw.nnrp.telstra.net 947136072 203.36.43.136 (Thu, 06 Jan 2000 16:21:12 EST) |
| NNTP-Posting-Date: | Thu, 06 Jan 2000 16:21:12 EST |
| Organization: | Customer of Telstra Big Pond Direct |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hi Jeff,
Found this in another news group - might be of use:
-------------------------------------------------
Here's three things you can try:
1) alias cls='echo -n ^[[2J' # the ^[ is an esc (in vi I use ^V followed
by
# ^[ where ^ is holding down the cntrl key)
2) compile this into clear.exe or cls.exe:
#include <stdio.h>
int main () { printf("033[2J"); }
3) alias cls='cat ~/.cls'
where .cls contains just these 4 chars with no \n or spaces (ESC [ 2 J)
---------------------------------------------------
Some discussion followed which may also be of interest to you; here's the
link:
http://www.cygnus.com/ml/gnu-win32/1997-Jul/0013.html
Col
Jeff Williams wrote:
> OK, it's always the simple stuff that confuses me...
>
> Is there a GNU version of the Unix `clear' for clearing the screen a la
> DOS `cls'. This would be useful inside bash. At present I have
> aliased `clear' to `/dos/command.com /c cls', but I'd rather not use
> command.com for anything.
>
> Relatedly, the man page for bash 2.02.0(1) says:
>
> clear-screen (C-l)
> Clear the screen leaving the current line at the top of
> the screen. With an argument, refresh the current line
> without clearing the screen.
>
> This means Control-l, yes? If so, it doesn't work for me.
>
> TIA---jtw
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |