Sponsored Content
Operating Systems OS X (Apple) A means of clearing the scroll buffer in an OSX Terminal. Post 303020727 by wisecracker on Thursday 26th of July 2018 09:38:52 AM
Old 07-26-2018
A means of clearing the scroll buffer in an OSX Terminal.

I was looking for a method of clearing the buffer of the vertical scroll back slider and came across this little Terminal escape snippet I had never seen before:
Code:
printf "%b" "\033[3J"

SO...
Code:
printf "%b" "\033c\033[3J\033[2J\033[0m\033[H"

Performs a terminal reset, buffer clearance, clear the window, set back to default colours etc... and places prompt at the top.
Neat eh!
Even the builtin Terminal reset command doesn't do that.
(This also works under 'xterm' too.)
These 4 Users Gave Thanks to wisecracker For This Post:
 

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Changing OSX Terminal Man Page Colors

For a long time, when I type man anything on my Mac, both the manpage header fonts and the background was black, so I had to use my mouse to highlight the manpage output to read it. It was really annoying. The problem was the same both locally or using the terminal and going ssh somewhere. ... (1 Reply)
Discussion started by: Neo
1 Replies

2. UNIX for Dummies Questions & Answers

Help: Add email users in OSX terminal

Please forgive me if this is the wrong place to post. I am a VERY basic user here and have been tasked with adding a user to our email system -- we use a squirrelmail interface and I have root passwords etc. I tried logging in through a browser but get this error: ERROR: Connection dropped... (1 Reply)
Discussion started by: dperro01
1 Replies

3. OS X (Apple)

Help: Add email users in OSX terminal

Please forgive me if this is the wrong place to post. I am a VERY basic user here and have been tasked with adding a user to our email system -- we use a squirrelmail interface and I have root passwords etc. I tried logging in through a browser but get this error: ERROR: Connection... (1 Reply)
Discussion started by: dperro01
1 Replies

4. Shell Programming and Scripting

How can I scroll the terminal output with Expect

Hi, I'm trying to come up with a simple expect script that allows me to login to a system and run a single command ... something like this: #!/usr/bin/expect -f # let's set some variables #set password set ipaddr set ponumber set hostname set timeout -1 # let's now connect to the... (0 Replies)
Discussion started by: danielsf
0 Replies

5. OS X (Apple)

How to prompt for login on OSX when starting Terminal

I was wondering if anyone can tell me how to log back in to unix after logging out. I have a MBPro. If I don't have the window close after exiting, then there is the phrase 'process completed' in brackets with a blinking cursor, but I can't type anything in. Is it also possible to start the... (4 Replies)
Discussion started by: Straitsfan
4 Replies

6. UNIX Desktop Questions & Answers

help with some basic osx terminal commands. fixing permissions on NAS share

I'm hoping someone here can help me. I'm computer literate but by no means an expert! I'm simply trying to recover data from my DLink DNS343 NAS mounted on my X86 iMac using SMB. Somehow, in moving to a new computer, I have lost access to some files on the NAS. Just some files are access denied. ... (0 Replies)
Discussion started by: Quantaa
0 Replies

7. OS X (Apple)

How to access a NTFS partition on hard drive through Terminal in OSX ?

Hi , I have a Mac OS X Lion mac book pro. I have a hard drive which I have partitioned in two (a) OSX Partition - Mac OS Extended Journaled format. Mount point: / (b) Data Partition - Windows NT Filesystem format. Mount point: /Volumes/Data I need to access the NTFS partition (I have a... (6 Replies)
Discussion started by: neil.k
6 Replies

8. UNIX for Dummies Questions & Answers

Terminal emulation OSX Vs. Solaris 11

I am using Terminal on an OSX system to access and edit crontab files on a 'headless' Solaris 11 server. Crontab -e on OSX invokes vi as the editor, which is fine, but I am getting unexpected characters on keystrokes and have to abort the edit. If this is an emulation issue, would someone please... (1 Reply)
Discussion started by: SmokeyJoe
1 Replies

9. OS X (Apple)

Osx terminal

hi all, first off thesis my first post so if i am not in the right forum, i apologize. i'm an absolute newbie to unix. i've been reading my books and studying my crib sheets etc. but... :/ i want to accomplish two things. 1. search and remove duplicate files i.e.. audio, doc alias etc.... (1 Reply)
Discussion started by: monkeyhateclean
1 Replies

10. OS X (Apple)

A new OSX 10.12.x terminal from the command line.

Hi guys and gals... After much searching on the good ol' internet I could find nothing, so this is the result. ALthough many people seem to have asked this question no-one seems to have a solution so here we go. I need for AudioScope.sh, 'xterm' to run a second program for some of its... (2 Replies)
Discussion started by: wisecracker
2 Replies
scroll_lines(5) 						File Formats Manual						   scroll_lines(5)

NAME
scroll_lines - number of scrollable lines used by the Internal Terminal Emulator VALUES
Failsafe Default Allowed values Recommended values No larger than is sufficient for a user's purposes. DESCRIPTION
This tunable specifies the total number of scroll buffer lines used by the HP-UX graphics console Internal Terminal Emulator (ITE). This value is the sum of both on-screen and off-screen lines. For instance, if the ITE has 68 on-screen lines, and the value of scroll_lines is 128, then there will be 60 off-screen lines that can be scrolled back into view. During boot, the system may adjust the value of upward, depending upon the installed graphics hardware. On graphics cards capable of run- ning at more than one resolution, the ITE will first determine the maximum number of on-screen lines across all possible resolutions. The ITE will then ensure that is at least equal to this number of on-screen lines. For example, assume the graphics card supports two possible resolutions which result in one ITE resolution of 160 characters by 62 lines and another ITE resolution of 120 characters by 78 lines. If a value of 62 had been specified for in the system file, the ITE would then adjust this value upwards to 78. Who Is Expected to Change This Tunable? Anyone. Restrictions on Changing Changes to this tunable take effect at the next reboot. When Should the Value of This Tunable Be Raised? The value of can be increased if the user would like to retain additional lines in the scroll buffer. What Are the Side Effects of Raising the Value of This Tunable? Increasing the size of the ITE scroll buffer consumes kernel memory which will be dedicated to the ITE and cannot be used for other pur- poses by the rest of the system. Memory is used at the rate of 2 bytes per off-screen character. When Should the Value of This Tunable Be Lowered? If the additional off-screen lines in the scroll buffer are not required, can be decreased to free up a small amount of memory. The sav- ings will be two bytes per off-screen character. For instance, if the display is 160 characters wide, decreasing by 10 will free up 3200 bytes. What Are the Side Effects of Lowering the Value of This Tunable? If is set below or equal to the number of lines displayed on the ITE screen, no off-screen text will be accessible. What Other Tunables Should Be Changed at the Same Time? None. WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. Tunable Kernel Parameters scroll_lines(5)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy