[texshop] TeXShop hangs when lock screen kicks in

Bruno Voisin bvoisin at icloud.com
Sun Aug 6 19:59:21 CEST 2023


> On 6 Aug 2023, at 17:32, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> 
> On an M1 Mac Studio runnig macOS Ventura 13.5, TeXShop 5.15 hangs when I log back in after the lock screen has kicked in if there had been an open .tex source window before the computer went to sleep and then went to the lock screen.
> 
> This has happened with earlier macOS and earlier TeXShop versions as well.
> 
> Could it have something to do with my opening TeXShop via a Terminal command that also opens several other apps? The command, in ~/.profile is the alias "texset" defined there as follows:
> 
> alias texset='opentexpdfs;sleep 5;mintexpdfs;for a (easyfind copyless\ 2 WindowMizer);do open -a $a;done;open ~/Documents/My_publications/Topology_book_2ed/Topology2Source;opentxtexs;sleep 5;open -a texshop'
> alias opentxtexs='open -a TextEdit.app ~/Documents/My_publications/Topology_book_2ed/ref/standard\ examples\ crefs.txt'
> alias opentexpdfs='for a (~/Documents/My_publications/Topology_book_2ed/ref/Topology_1ed_Eisenberg.pdf ~/Documents/My_publications/Topology_book_2ed/trials/ref-style-key/ref-style-key.pdf ~/Documents/My_publications/Topology_book_2ed/Topology2Source/topology2.pdf);do open -a Skim.app $a;done'
> 
> When I first reported this issue to this list in September 2022, I seem to recall being advised to capture some log file, but i don't now find that reply. Which log file?

Unfortunately there's not much I can think of to help. Looking through my TeX mailbox, I can find your initial message from September 26, 2022

> On a Mac Studio running macOS Monterey 12.6, TeXShop 5.03 hangs after I wake the computer from sleep if there had been an open .tex source window. When I move the cursor over that window, it gets somewhat grayed out, and I see a circular delay icon (with spokes that go around).
> 
> I think this happened with some earlier TeXShop versions, too, and maybe even with earlier version of Monterey.

but no answer to it.

As for the log file you were suggested to capture, you need to find the exact instructions that were given to you. A few years ago, macOS moved from separate log files to a continuous stream of messages where everything (from OS and apps) is mixed together. You need to filter this, either in the Console app or using "log" in Terminal, in order to get some useful info out of it.

>From time to time I find some magical invocation somewhere on a web page, like

	log stream --style syslog  --predicate 'senderImagePath contains[cd] "TimeMachine"' --info
	log show --style syslog  --predicate 'senderImagePath contains[cd] "TimeMachine"' --info

to display logs for Time Machine (the first form filtering the stream live, the second form filtering the previous stream). But I have no idea what would fit your specific purpose here.

Maybe (with TeXShop on and a window opened in it) open the Console app, start the streaming, enter TeXShop in the search field, get your Mac to sleep (I've no idea how to do that), wake it up, see whether TeXShop is frozen, look inside Console if some message is displayed at about the time the Mac woke up.

There's also the always helpful Eclectic Light Company, here

	https://eclecticlight.co/2016/10/17/log-a-primer-on-predicates/
	https://eclecticlight.co/2016/10/01/using-the-logs-in-sierra-some-practical-tips/

The second page says in particular

> To look for a system waking up,
> 
> log show --predicate 'eventMessage contains "System Wake"' --style syslog --info | cut -c 1-22,43-999
> 
> You can then look at errors immediately before and after that date and time, e.g.
> 
> log show --predicate 'messageType == error' --style syslog --start '2016-09-30 06:57:10' --end '2016-09-30 06:59:00' --info | cut -c 1-22,43-999
> 
> and if that doesn’t tell you what went wrong, try dumping that window into a text file and browsing through it, with
> 
> touch ~/Documents/logrestart.text
> log show --start '2016-09-30 06:57:10' --end '2016-09-30 06:59:00' --info > ~/Documents/logrestart.text

All this said, looking at your .profile, I'm not sure it plays any role. Some info's missing (what's mintexpdfs, and I also have no idea what "easyfind copyless\ 2 Windowmizer" means), but I have the impression the only relevant part is "open -a texshop" which should work.

Maybe just replace it with "open -a /Applications/TeX/TeXShop.app", to be sure? Or use the -W option to open? Or -n?

Since you're opening things with Terminal, have you checked whether Terminal has full disk access (in System Settings > Privacy & Security)?

Maybe you can check with System Info (in the Utilities subfolder of Applications), in the Software > Applications category, whether you have only one TeXShop app on your setup, or several copies.

Finally, since you're on Ventura, have you checked the setting "Close windows when quitting an application" in System Settings > Desktop & Dock > Windows?

For me the "slider" (is that the proper English name for that piece of UI?) is off, meaning the windows that were left open when I last quit TeXShop are restored at launch. But I've find this setting to be somewhat unreliable, most of the times the opened windows are restored, but sometimes they aren't. I couldn't say whether only TeXShop is affected, or other apps as well, I didn't pay attention.

Maybe this interferes with the Mac getting to sleep and waking up in some way?

BTW, my setup is an M1 MacBook Pro 13" from 2020 with maOS Sonoma 14.0 Developer Beta 4 from July 31.

Bruno Voisin





More information about the texshop mailing list.