Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTerm2: Export session to text/pdf file

Tags:

iterm2

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.

like image 204
MitterHai Avatar asked Nov 20 '25 13:11

MitterHai


2 Answers

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

like image 166
Andrew Bobulsky Avatar answered Nov 22 '25 04:11

Andrew Bobulsky


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

enter image description here

like image 41
SushiHangover Avatar answered Nov 22 '25 02:11

SushiHangover