iTerm/OSX Terminal: Change text margin from edge of window
Solution 1
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
.
Solution 2
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.
Related videos on Youtube
Caleb Xu
Updated on September 18, 2022Comments
-
Caleb Xu over 1 year
Currently, I use iTerm on OS X. My terminal looks something along these lines:
I came across this picture of a terminal setup on GitHub, and I wanted to imitate it:
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
, notstderr
and piping it withbash -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)?
-
lzam over 9 yearsWell, for your prompt you could always try adding
export PS1=" $PS1"
(give or take a space) to ~/.profile -
Caleb Xu over 9 yearsYes, I figured that would work out pretty easily, but there's no good way to indent the rest of the output, unfortunately.
-
-
Caleb Xu over 9 yearsStill easier changing two variables than meddling around with a bunch of messy pile of shell script. Thanks!
-
Kevin Suttle over 8 yearsStill 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
-
Aviel Gross over 7 yearsThose defines now reside in
iTermTextDrawingHelper.h
-
Caleb Xu over 7 yearsJust to provide an update, these defines no longer work. You can find margin settings in the Advanced section of the preferences.
-
Chris Page almost 6 yearsThis answer would be improved by describing the location of these preferences.