You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Printing problem with Custom Version 9.0.472 (174) on MacOS Ventura 13.0.1 #1347
Open a text file in MacVim
Print the file (using command-P or File->Print)
MacVim reports "Print job sent" and opens the Preview App, but the file is not opened in Preview. Clicking on the Preview icon in the Dock brings up an open file window.
Expected behaviour
Up until the most recent Ventura update, the file would be opened in Preview. and could be printed with Command-P.
I suspect this may be the result of a tightening of security features in Mac OS, which may be preventing the creation of an intermediate file, or preventing its being opened by Preview.
Version of Vim and architecture
Version 9.0.472 (174)
Environment
MacOS Ventura 13.0.1 Intel Processor on iMac Retina 5K 27 Inch 2020
How MacVim was installed
MacVim updated via MacVim->Check for updates
Logs and stack traces
No response
Vim configuration where issue is reproducable
No response
Issue has been tested with given configuration
by running MacVim.app from GUI macOS interface
by running vim/gvim/etc installed by MacVim
by running other versions of vim (e.g. /usr/bin/vim)
Issue has been tested with no configuration
by running mvim --clean (or gvim, supplied by MacVim distribution)
by running vim --clean (in terminal, supplied by MacVim distribution)
by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)
Other conditions
The both Homebrew packages "vim" and "macvim" are installed
PS It turns out that the above only works for vim, run from the command line, and saves 0.ps etc in the current working directory, before opening the .PDF in Preview. I don't know what directory MacVim sends its output to.
"...The Preview app included with your Mac supports PostScript (.ps) and Encapsulated PostScript (.eps) files in macOS Monterey or earlier. Starting with macOS Ventura, Preview no longer supports these files. Other apps that can view or convert .ps and .eps files are available from the App Store and elsewhere..."
Oh crap yeah you are right, now I vaguely remember reading about the drop of PostScript support and was thinking "who still uses PostScript" lol. Famous last words…
I guess we could either bundle ps2pdf or find another alternative. I will need to think about it a little.
Btw, @MichaelHendry , I'm wondering if you have tried the :TOhtml command before and see if that solves your issue? It's another way to tackle the issue but it generates an HTML page that you can then print in a browser. I'm just trying to gather how important it is to fix this issue.
Also, if you want a shorter term fix, I believe you can set printexpr to be system(['lpr'] + (empty(&printdevice)?[]:['-P', &printdevice]) + [v:fname_in]). delete(v:fname_in)+ v:shell_error. Only issue with using lpr is that it directly sends the doc to the printer, without a way to preview it which is kind of sucky.
Now that I've upgraded to Sonoma, I'm having a problem with printing from Adobe Acrobat, which fails to print with the following explanation::
Stopped. Michael Hendry, "Filter" failed. 0 pages, 1 copy
The hardcopy method above works, but I'd prefer not to have to remember these magic spells.
My .gvimrc file now reads as follows:
set tabstop=4
set shiftwidth=4
"se printexpr=system('ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf\ &&\ open\ '.v:fname_in.'.pdf')\ +\ v:shell_error
se printexpr=system('ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf\ &&\ open\ -a\ Preview\ '.v:fname_in.'.pdf')\ +\ v:shell_error
Having completed this comment, I realise that the problem probably lies with Acrobat, not MacVim, but it may help another Mac User who has recently upgraded to Sonoma.
which works around the problem by directing the output specifically to Preview instead of the default application for .PDF files.
Huh, I didn't consider the possibility that someone may have assigned another application to open PDFs by default. Let me play around with Acrobat a little first before I decide how to resolve this. I wonder if the issue is since we delete the PDF after a timeout.
Actually @MichaelHendry , why do you still have an explicit printexpr set? You know that this was fixed a while ago (r177) in July right? It will automatically use Preview to open it. You should just remove the line that sets printexpr in your vimrc.
You're absolutely right - I don't need the printexpr line for MacVim.
I've been grappling with the use of a non-graphical version of vim which is called by "LifeLines" - a curses-based genealogy program which calls an external editor to edit information in its GEDCOM database. I can't use MacVim for this because Mac OS doesn't use the same calling convention for "open file X in application Y".
I can work around this by copying-and-pasting into an opened copy of MacVim.
Ok, actually… Sonoma broke printing, again, sigh. The fix we did last time used pstopdf which was an Apple bundled tool, but macOS 14 Sonoma has completely removed Postscript support so that tool got nuked as well. Currently investigating options, but maybe I'll just force users to install ps2pdf instead. Printing is a niche enough thing.
Activity
ychin commentedon Nov 29, 2022
I can reproduce. Looking into it. Meanwhile you can manually use the
:hardcopyVim command to work around it.MichaelHendry commentedon Nov 30, 2022
Thanks, ychin.
I'll stop the (now proved futile) sequence of uninstallation, re-installation, rebooting etc!
I'd tried the :hardcopy command, but got the same result as Cmd-P.
Michael
ychin commentedon Nov 30, 2022
For hardcopy you should be able to save it out to a dedicated file (or you can just modify
printexpr). Then you can manually open that in Preview.MichaelHendry commentedon Nov 30, 2022
The problem seems to be that Preview no longer opens .ps files - they're ghosted when I try a File-Open in Preview.
I've worked around the problem using the following:
:hardcopy > 0.ps | !ps2pdf 0.ps && open -a preview 0.pdf
0.pdf is then opened in Preview and can be printed in the usual way.
MichaelHendry commentedon Nov 30, 2022
PS It turns out that the above only works for vim, run from the command line, and saves 0.ps etc in the current working directory, before opening the .PDF in Preview. I don't know what directory MacVim sends its output to.
MichaelHendry commentedon Nov 30, 2022
Preview on Ventura no longer supports .PS files, see:
https://support.apple.com/en-us/HT213250
"...The Preview app included with your Mac supports PostScript (.ps) and Encapsulated PostScript (.eps) files in macOS Monterey or earlier. Starting with macOS Ventura, Preview no longer supports these files. Other apps that can view or convert .ps and .eps files are available from the App Store and elsewhere..."
ychin commentedon Dec 1, 2022
Oh crap yeah you are right, now I vaguely remember reading about the drop of PostScript support and was thinking "who still uses PostScript" lol. Famous last words…
I guess we could either bundle
ps2pdfor find another alternative. I will need to think about it a little.MacVim Release 176
ychin commentedon Mar 15, 2023
Btw, @MichaelHendry , I'm wondering if you have tried the
:TOhtmlcommand before and see if that solves your issue? It's another way to tackle the issue but it generates an HTML page that you can then print in a browser. I'm just trying to gather how important it is to fix this issue.Also, if you want a shorter term fix, I believe you can set printexpr to be
system(['lpr'] + (empty(&printdevice)?[]:['-P', &printdevice]) + [v:fname_in]). delete(v:fname_in)+ v:shell_error. Only issue with usinglpris that it directly sends the doc to the printer, without a way to preview it which is kind of sucky.Fix :hardcopy not working in macOS 13 Ventura
Fix :hardcopy not working in macOS 13 Ventura
1 remaining item
Fix :hardcopy not working in macOS 13 Ventura
Fix :hardcopy not working in macOS 13 Ventura
Fix :hardcopy not working in macOS 13 Ventura
Fix :hardcopy not working in macOS 13 Ventura
Fix :hardcopy not working in macOS 13 Ventura
jubilatious1 commentedon Apr 6, 2023
#1390 (comment)
jubilatious1 commentedon Apr 6, 2023
This works in
MacOS Ventura 13.3withMacVim: Vim 9.0.1276 (MacVim r176).@MichaelHendry
Fix :hardcopy not working in macOS 13 Ventura
MichaelHendry commentedon Nov 2, 2023
Now that I've upgraded to Sonoma, I'm having a problem with printing from Adobe Acrobat, which fails to print with the following explanation::
Stopped. Michael Hendry, "Filter" failed. 0 pages, 1 copy
The hardcopy method above works, but I'd prefer not to have to remember these magic spells.
My .gvimrc file now reads as follows:
set tabstop=4
set shiftwidth=4
"se printexpr=system('ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf\ &&\ open\ '.v:fname_in.'.pdf')\ +\ v:shell_error
se printexpr=system('ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf\ &&\ open\ -a\ Preview\ '.v:fname_in.'.pdf')\ +\ v:shell_error
Having completed this comment, I realise that the problem probably lies with Acrobat, not MacVim, but it may help another Mac User who has recently upgraded to Sonoma.
which works around the problem by directing the output specifically to Preview instead of the default application for .PDF files.
ychin commentedon Nov 2, 2023
Huh, I didn't consider the possibility that someone may have assigned another application to open PDFs by default. Let me play around with Acrobat a little first before I decide how to resolve this. I wonder if the issue is since we delete the PDF after a timeout.
ychin commentedon Nov 9, 2023
Actually @MichaelHendry , why do you still have an explicit
printexprset? You know that this was fixed a while ago (r177) in July right? It will automatically use Preview to open it. You should just remove the line that setsprintexprin your vimrc.MichaelHendry commentedon Nov 11, 2023
You're absolutely right - I don't need the printexpr line for MacVim.
I've been grappling with the use of a non-graphical version of vim which is called by "LifeLines" - a curses-based genealogy program which calls an external editor to edit information in its GEDCOM database. I can't use MacVim for this because Mac OS doesn't use the same calling convention for "open file X in application Y".
I can work around this by copying-and-pasting into an opened copy of MacVim.
ychin commentedon Dec 8, 2023
Ok, actually… Sonoma broke printing, again, sigh. The fix we did last time used
pstopdfwhich was an Apple bundled tool, but macOS 14 Sonoma has completely removed Postscript support so that tool got nuked as well. Currently investigating options, but maybe I'll just force users to installps2pdfinstead. Printing is a niche enough thing.Fix macOS 14 Sonoma printing to use ps2pdf instead