Since upgrading to OS X El Capitan, I've noticed a change in the Terminal: Executed lines show an opening bracket on the left, and a closing bracket on the right, as shown in this screenshot:

Terminal

Similar questions have been asked here:

Some of the questions are referring to these brackets as marks, and the Terminal's Edit menu has a couple of entries related to marks, for example:

  • Edit > Marks > Mark as Prompt and Send Return
  • Edit > Clear to Previous Mark
  • Edit > Navigate > Jump to Previous Mark

Edit Menu

Is there a summary of what these marks can be used for? I have not seen any reference to this new feature in any of the El Capitan feature overviews.

  • 9
    If only we had found a better way to pay Siracusa enough to scrutinize the OS for months on end.... – bmike Oct 22 '15 at 14:58
up vote 146 down vote accepted
+50

Marks in the Terminal

The new Terminal marks (available starting with OS X 10.11 - El Capitan) are similar to Bookmarks, which are also available in the Terminal, allowing you to mark window positions and then giving you the option of going back at a later point.

Marks (or Bookmarks) don't refer to your command history, but to the scroll buffer used in the Terminal window/tab.

Marking a Line

By default, every time you press Enter in the Terminal window, the line is marked, which is displayed using an opening bracket at the beginning of the line and a closing one at the very end. This default behavior can be turned off using the Edit > Marks > Automatically Mark Prompt Lines menu entry. When this is disabled, you can still manually execute and mark a command using Cmd+Enter (or with the Edit > Marks > Mark as Prompt and Send Return menu entry).

If you have automatic marking enabled and want to run a command without marking it as a prompt, you can do this using Cmd+Shift+Enter (or with the Edit > Marks > Send Return Without Marking menu entry).

Disabling Marks

Automatic marking of lines can be disabled using the Edit > Marks > Automatically Mark Prompt Lines menu entry.

From the command line, the same can be achieved using

defaults write com.apple.Terminal AutoMarkPromptLines -bool NO

Hiding Marks

If you want to use the mark functionality, but don't want to see the brackets at the beginning and end of the line, you hide them using the View > Hide Marks menu entry. This will keep the below functionality intact, but will no longer show the brackets.

Jumping between Marks

Once a line has been marked, you can quickly jump to the previous mark using Cmd+Up or to the next one using Cmd+Down. Similar options are provided for Bookmarks, and for selecting to the next/previous mark:

Edit Menu

Manually Marking a Line

In addition to the automatic marking, you can also manually add marks by selecting a line in the terminal output using the mouse, and then selecting the Edit > Marks > Mark as Prompt menu entry (or Cmd+U).

Use Cases

The Marks functionality is useful if some of your executed commands produce lots of output, and you quickly want to scroll to the position where you entered the command. Pressing Cmd+Up will take you there. Pressing it repeatedly will take you further up, while pressing Cmd+Down will take you back down again. The target location is conveniently highlighted as you jump/scroll around.

Marks Usage

Selecting Content

The same marks functionality can be used for selecting Terminal output. Pressing Cmd+Shift+Up will select the content up to the previous mark, while Cmd+Shift+Down will select down to the next mark. This is useful when wanting to copy log output or other content from the Terminal.

This functionality is also available from the Edit > Navigate menu while pressing the Shift key:

Navigate Menu

Summary

Having used this for a couple of days now, I find it incredibly useful. Scrolling up through hundreds of lines of output to find the beginning of the command's output has suddenly become a lot easier.

I wonder why this new feature isn't mentioned more prominently - I haven't seen it in any of the El Capitan walkthroughs. The Terminal help currently does not provide any details on this feature either.

  • 1
    Great answer. Just to add a little bit, Bookmarks can be named too, so think of Bookmarks as Chapters in a book and marks as Paragraphs. You could create a new Bookmark when starting a new task in the same Terminal, handy in recalling exactly where you started and what you did. – user14492 Oct 25 '15 at 15:21
  • This is actually really useful. Thanks for this great explanation! I was wondering why I observed the same thing months back, but I ignored it, until I realized it had nothing to do with my modified PS1. Great! – bretonics Apr 9 '16 at 22:35

Looks like a form of 'quick/light bookmarking'. I guess disabling 'Automatically mark prompt lines' makes its function more evident. After doing that, Cmd-Enter explicitly saves the mark, and Cmd-Up/Down jumps between them.

As you can convert marks to bookmarks and vice versa, I'd see them as lightweight or second-level bookmarks.

  • 1
    That doesn't seem entirely accurate. When I use Cmd+Up, it doesn't cycle through my history, but scrolls the whole Terminal window to the previously marked command. – nwinkler Oct 7 '15 at 7:30
  • I do not have El Capitan installed (yet) and my answer is a bit off-topic. If this is a history search feature like mentions by @fonso, it looks like Apple reengineered the old <kbd>CTRL</kbd>-<kbd>R</kbd> feature of bash, where you could do a reverse interactive history search. And Apple seems having visualized it. – Garex Oct 7 '15 at 12:39
  • 2
    No, it's not. As I have said in my comment, it does not have any overlap with the CTRL+R history search. It looks like the marks feature works as a kind of automatic bookmark, letting you scroll up through the terminal window's buffer quickly. – nwinkler Oct 7 '15 at 13:17
  • Sorry, you're all completely right, it's marking the scroll point, not history! I'll edit the answer. – fonso Oct 8 '15 at 8:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.