Macos – iTerm/OSX Terminal: Change text margin from edge of window

bashcommand linemacosterminal

Currently, I use iTerm on OS X. My terminal looks something along these lines:

My terminal

I came across this picture of a terminal setup on GitHub, and I wanted to imitate it:

Target terminal

Specifically, I wanted to change the padding/margin along the left side/bottom side of the window. While the picture in question appears to utilize OSX's default Terminal, I'm hoping it can be done in iTerm as well, although an OSX Terminal-specific solution would work too.

I've tried looking through iTerm and OSX Terminal's preferences (especially under the "Window" section on iTerm, but I have looked elsewhere), and I have yet to find an option for adjusting where the characters start along the left side.

I've also tried to implement this programmatically in Bash:

bash -l | sed 's/^/ /'

This seems to work fairly well, although it only indents program output, not my prompt line (and I'm having trouble setting such a piped command as my login shell).

Also, it only adjusts stdout, not stderr and piping it with bash -l 2>&1 simply hides all of Bash's output altogether.

Have I just overlooked some setting in iTerm/OSX Terminal? Is there any other way to set an "inner text area" within the Terminal window (i.e. set padding along the sides)?

Best Answer

If anyone comes up at this question, this functionality is available via this plugin for iTerm2:

https://github.com/jaredculp/iterm2-borderless-padding

And from iTerm 3.1 on (currently in alpha), you can have it as an advanced option in height of top and bottom margins and width of left and right margins.

Related Question