Terminal history/scroll bars.

Hey guys,

Im pretty new to Mac and Applescript. But i am familiar with other languages. Anyway, im for a way to clear the Terminal window i.e. like Command-K…

I would use the “clear” command but this just adds white space; not the effect im going for :?.

Any help would be much apreciated!

Mark.

cmd-w, cmd-n :slight_smile:

But how do i call that from inside a script. Like i said, im pretty new to Mac.

Mark.

Moorsan’s suggestion will not quote do what you want.

His idea is to close the current window and open a new one. While this will give you a window with no history, it will also kill any process that was going on in that window. For example, say you were ssh’d to a remote machine and you wanted to clear the history - this approach would close your ssh session and lose whatever you were doing at the time.

Unfortunately, though, there is no other obvious way of clearing the history. Terminal.app specifically marks the history of each window as being read-only, meaning a script can’t change it’s value. You can get the history, but you can’t clear it. About the closest you can get is UI scripting to change the window history buffer to a small value, then reset it, but that’s very clunky.

Um, why not just use Command-K?

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Because that involves actually looking at Terminal.app to see what menu options it supports? :wink: