Skip to content

Instantly share code, notes, and snippets.

Created July 21, 2021 15:05
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dpiponi/3abef1f9d18f7d648aed2480969fe148 to your computer and use it in GitHub Desktop.
(** User Mathematica initialization file **)
(** See for info on instaling this file **)
(** Display graphics inline in iTerm2. I don't know an easy way to test if we're running in iTerm2 without looking at the process table. **)
WriteString[$Output, "\033]1337;File=inline=1:"<>ExportString[ExportString[image,"PNG"],"Base64"]<>"\007"];
(** `ListAnimate` seems to work but `Animate` doesn't. **)
WriteString[$Output, "\033]1337;File=inline=1:"<>ExportString[ExportString[image,"GIF"],"Base64"]<>"\007"];
Copy link

dpiponi commented Jul 21, 2021

This allows Mathematica to inline images when Wolframscript is used from the iTerm2 terminal on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment