3

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)?

  • Well, for your prompt you could always try adding export PS1=" $PS1" (give or take a space) to ~/.profile – lzam Sep 11 '14 at 23:33
  • Yes, I figured that would work out pretty easily, but there's no good way to indent the rest of the output, unfortunately. – Caleb Xu Sep 11 '14 at 23:51
2

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.

  • This answer would be improved by describing the location of these preferences. – Chris Page Jun 29 '18 at 4:08
7

Seems like an option, although involves some compile& build hassle http://hackr.it/articles/prettier-gutter-in-iterm-2/

i.e., you have to clone https://github.com/gnachman/iTerm2.git and then patch sources/PTYTextView.h

33c33
< #define MARGIN  5
---
> #define MARGIN  15
36c36
< #define VMARGIN 2
---
> #define VMARGIN 12

and then make it.

  • Still easier changing two variables than meddling around with a bunch of messy pile of shell script. Thanks! – Caleb Xu Feb 1 '15 at 22:10
  • Still works for me. Only caveat is that in the current beta builds, the "cursor guide" (persistent line highlight) doesn't go full-bleed. cloudup.com/cD9Leds1Wof – Kevin Suttle Dec 26 '15 at 3:26
  • Those defines now reside in iTermTextDrawingHelper.h – Aviel Gross Aug 24 '16 at 4:17
  • Just to provide an update, these defines no longer work. You can find margin settings in the Advanced section of the preferences. – Caleb Xu Jan 28 '17 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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