subl command gives timeout error in sudo
Description of the bug
- it might be related to https://github.com/sublimehq/sublime_text/issues/3897 - but that one is closed, and the steps are somewhat different.
- When opening a file or folder using the
sublcommand with sudo, I get the error:
Timeout waiting for detached instance to start: No such file or directory
Steps to reproduce
- To reproduce this bug, sublime cannot already be running, in safe mode or otherwise
- type
sudo subl .in any directory to want to work in.sudo subl . --safe-modewill also reproduce the problem for me.
Expected behavior
I expected sublime to open the folder
Actual behavior
- An empty window opens, ie. the expected files and folders in the
.directory do not appear - The terminal reports error: "Timeout waiting for detached instance to start: No such file or directory"
Sublime Text build number
4126
Operating system & version
macOS 12.3.1
(Linux) Desktop environment and/or window manager
No response
Additional information
No response
OpenGL context information
No response
Can reproduce on an older Build as well:
Sublime_Text:
build: 4116
channel: dev
platform: osx x64
portable: false
pre_session_restore_time: 0.26502
startup_time: 0.38377
first_paint_time: 0.49481
env_vars: '/bin/zsh -l'
System:
hardware: MBP 15inch 2018, 2.9 GHz 6-Core Intel Core i9, 32GB 2400 MHz DDR4, 1TB, Radeon Pro 560X
software: macOS Monterey 12.3.1 (21E258)
kernel_version: Darwin 21.4.0
open_gl:
gl_api_version: 4.1 INTEL-18.5.8
glsl_version: 4.10
vendor: Intel Inc.
renderer: Intel(R) UHD Graphics 630, 1536 MB
Same issue here with Sublime Text Build 4126
I can't reproduce this in build 4168. This has likely been fixed.
Nope, still broken in 4169!
I still can't reproduce it @robinkaty . Can you provide a demonstration?
Benjamin, here is a screen grab. https://github.com/sublimehq/sublime_text/assets/11369418/db76001e-0126-4047-8889-50fd8b579046
If I enable root via the directory_utility and login as root under the full MacOS Gui I can use subl [file] and it will start sublime , it appears to have an issue saving.
But: sudo "subl /private/var/root/.vim/.netrwhist" generates Timeout waiting for detached instance to start: No such file or directory
What version of macOS are you using?
14.2 seems to work as expected I can sudo su - , and then open root files and I get a sublime window. in another shell I can open a window for my local user sudo subl /var/root/rob.txt and it works.
14.3.1 and 14.4 seem to have issues.
both sudo subl /var/root/rob.txt
or starting a new login shell with sudo su - and then trying to edit
sudo /var/root/rob.txt
fail with the "Timeout waiting for detached instance to start: No such file or directory"
12.7.3 sudo subl /var/root/text.txt works as does sudo'ing to a shell and doing subl /var/root/rob.txt works
on 14.4 from a root shell, I can open sublime with "/Applicates/Sublime Text.app/Contents/MacOs/sublime_text" , but subl fails. Just tested this also works on 14.3.1 and if done from root home, I can then use file open to open a file.
cd /var/root "/Applications/Sublime Text.app/Contents/MacOS/sublime_text" root.file (this also works but starting it this way gives some bootstrap warnings)
could it be the odd permissons, maybe I will see about giving subl file access. nope, that didn't help. but I am starting to think it is something with "subl"
I had a response from someone else at support, they say it is changes in sonoma that are causing the issues with "sudo subl", so I will wait and see. Thanks for responding, Ben.