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
DwtScrollBarGetSlider(3Dwt)											       DwtScrollBarGetSlider(3Dwt)

Name
       DwtScrollBarGetSlider - Retrieves the current size and position parameters of the slider in the scroll bar widget.

Syntax
       void DwtScrollBarGetSlider(widget, value_return, shown_return,
				  inc_return, pageinc_return)
	    Widget widget;
	    int *value_return;
	    int *shown_return;
	    int *inc_return;
	    int *pageinc_return;

Arguments
       widget	 Specifies the scroll bar widget ID.

       value_return
		 Returns  the scroll bar's top thumb (slider) position between the DwtNminValue and DwtNmaxValue attributes to the scroll bar wid-
		 get.

       shown_return
		 Returns the size of the slider as a value between zero and the absolute value of DwtNmaxValue minus DwtNminValue.   The  size	of
		 the slider varies, depending on how much of the slider scroll area it represents.

       inc_return
		 Returns the amount of button increment and decrement.

       pageinc_return
		 Returns the amount of page increment and decrement.

Description
       The DwtScrollBarGetSlider function returns the currently displayed size/position values of the slider in the scroll bar widget.	The scroll
       region is overlaid with a slider bar that is adjusted in size and position using the main scroll bar or	set  slider  function  attributes.
       The stepping arrows and the slider are the scroll activator objects providing the user interface syntax ``feel.''

See Also
       DwtScrollBarSetSlider(3Dwt)
       Guide to the XUI Toolkit: C Language Binding
       Guide to the XUI Toolkit Intrinsics: C Language Binding

														       DwtScrollBarGetSlider(3Dwt)
All times are GMT -4. The time now is 01:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy