0

I'm using an application that outputs very long lines. It's fine - it means things aren't cut off at 80 characters - but the default Terminal and iTerm2 config makes it hard to distinguish between:

  • the second line of a wrapped long line
  • the start of the next line

Eg:

Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. 
Proin sed velit nibh. Proin ornare nisi 
at erat congue, vel dignissim tortor malesuada. 

Is there any way I can configure the app to show things so that there's some space after each carriage return, eg:

Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. 

Proin sed velit nibh. Proin ornare nisi 
at erat congue, vel dignissim tortor malesuada. 

Thanks very much!

2

Here's a starting point.

In iTerm 2 go to Preferences > Profiles > (Your profile) > Advanced, then click Edit under Triggers.

Add a new Trigger using the + button at the bottom left, then set:

  • Regular Expression: .$
  • Action: Highlight Text…
  • Parameters: Red on White (or a colour combination you find appropriately funkadelic)

Close the Triggers pane.

You should now see a white "line" at the far right of the iTerm window. This is really iTerm changing the last character on the line to red text on a white background. This should help you spot lines that are wrapped versus new lines.

Example screen grab below (I use fish shell, btw)…

Screen grab of iTerm2 fish shell showing use of Triggers to highlight text

0

One way around this would be to pipe your output through sed G to double-space the output, example:

cat file-with-long-lines.txt | sed G

Of course this modifies the output.

  • Ack, sed or tr would turn 1 CR into two, however I don't want to have to send stderr to stdout and use sed/tr on every command (and there's a lot of commands). – mikemaccana Jul 5 '13 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .