Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do want to add file view support for media files to midnight commander and I something that can be called form the command line that would start preview but that will return to my terminal when I press ESC.

Note: I already found half of the solution here - the only problem is that it doesn't close Preview with Escape.

So there are two possible solutions:

  • Find a way to map ESC to Cmd+Q only for Preview (I want a command line install solution)
  • Find a way to open Preview in the special mode used by the Finder (the tiny preview), which by default is closed with a simple Esc.
share|improve this question
up vote 4 down vote accepted

You could use qlmanage instead.

/usr/bin/qlmanage -p file1.pdf file2.pdf file3.pdf

This will open the files in quicklook.

You can then use escape or the space bar which will close the quicklook previews and be back in terminal since it is the active app.

share|improve this answer
+1, I didn't know about qlmanage. – lhf Dec 11 '12 at 16:33
How would I pipe the list of files in the current directory into /usr/bin/qlmanage -p ? – chishaku Sep 23 '14 at 17:08
@chishaku "thelist=ls;/usr/bin/qlmanage -p $thelist" but you will have a problem with non escaped file names – markhunte Sep 23 '14 at 17:18
How to remove "debug" mode? -d 1 still shows some debug messages. – Anton Tarasenko May 10 '15 at 21:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.