sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

subl command gives timeout error in sudo

Open jvsteiner opened this issue 3 years ago • 12 comments

Description of the bug

  1. it might be related to https://github.com/sublimehq/sublime_text/issues/3897 - but that one is closed, and the steps are somewhat different.
  2. When opening a file or folder using the subl command with sudo, I get the error:

Timeout waiting for detached instance to start: No such file or directory

Steps to reproduce

  1. To reproduce this bug, sublime cannot already be running, in safe mode or otherwise
  2. type sudo subl . in any directory to want to work in. sudo subl . --safe-mode will also reproduce the problem for me.

Expected behavior

I expected sublime to open the folder

Actual behavior

  1. An empty window opens, ie. the expected files and folders in the . directory do not appear
  2. 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

jvsteiner avatar May 04 '22 14:05 jvsteiner

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

jrappen avatar May 04 '22 17:05 jrappen

Same issue here with Sublime Text Build 4126

juanmbellini avatar May 24 '22 16:05 juanmbellini

I can't reproduce this in build 4168. This has likely been fixed.

BenjaminSchaaf avatar Feb 16 '24 04:02 BenjaminSchaaf

Nope, still broken in 4169!

robinkaty avatar Mar 10 '24 21:03 robinkaty

I still can't reproduce it @robinkaty . Can you provide a demonstration?

BenjaminSchaaf avatar Mar 12 '24 01:03 BenjaminSchaaf

Benjamin, here is a screen grab. https://github.com/sublimehq/sublime_text/assets/11369418/db76001e-0126-4047-8889-50fd8b579046

robinkaty avatar Mar 12 '24 02:03 robinkaty

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

robinkaty avatar Mar 12 '24 04:03 robinkaty

What version of macOS are you using?

BenjaminSchaaf avatar Mar 12 '24 04:03 BenjaminSchaaf

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

robinkaty avatar Mar 12 '24 05:03 robinkaty

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)

robinkaty avatar Mar 12 '24 05:03 robinkaty

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"

robinkaty avatar Mar 12 '24 05:03 robinkaty

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.

robinkaty avatar Mar 18 '24 17:03 robinkaty