12

I just recently switched from the default terminal where I was able to export a session to a document file, and I can't find the same option on iTerm2.

An alternative that I have tried based on my searches on the internet:

1) Turned on automatic session logs where it will log the activity of a session.

Problems with this: The saved log will have random spaces, random formatting, and weird texts in between what I write, such as "[k" in between my words.

Does anyone know how to export a session on iTerm2 similarly to the built in terminal?

And, no I don't want to consider cmd+a, cmd+s. I want to know how to properly export a session into a file.

Thank you.

MitterHai
  • 129
  • 2
  • 10

2 Answers2

18

In the menu bar:

Session > Log > Save Contents

Choose RTF as the file type.

Open the file in any Rich Text editor.

Video of the save process

Andrew Bobulsky
  • 1,070
  • 8
  • 9
9

PDF Export: Terminal's Shell / Print equals iTerm's Shell / Print / Buffer

enter image description here

SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • Hello @SushiHangover, thank you for replying. I have tried your suggestion, and this doesn't export a session into a pdf file -- it tries to print the session by sending it to a printer. – MitterHai Oct 15 '18 at 21:06
  • @MitterHai Yes, "Print to PDF", lower left hand side of any macOS printer dialog – SushiHangover Oct 15 '18 at 21:44
  • Hey @SushiHangover, thanks for the follow up. I followed your instructions and was able to export the file as intended. You are awesome! Thanks again! – MitterHai Oct 15 '18 at 22:03