 
        0
    
    
    
        
        
        Ikke en bug
        
        
    
    
    
    
    
    Sublime crashes after executing command which uses applescript to interact with it
Doing this in the console
import commands
commands.getoutput("osascript -e 'tell app \"Sublime Text 2\" to choose color'")
results in Sublime freezing and needing to be force-quit.
import commands
commands.getoutput("osascript -e 'tell app \"Sublime Text 2\" to choose color'")
results in Sublime freezing and needing to be force-quit.
Svar
 
0
	
    
	
	
	
	
	 Svar
	
	
	
		
	        Ikke en bug
		
	
	
	
		Jon Skinner 14 år siden
    
	The command you're entering blocks the main thread while awaiting a reply from the main thread of the current process. By definition, this can't work.
	
	
In general, as commands entered via the console are run in the main thread of the Sublime Text process, there are many ways to cause harm to the process. The only alternative would be to run a sandboxed version of Python that couldn't interact with the system, which would not be desirable.
The above aside, you may be able to get the desired result running the command via a thread in a plugin. However, due to the way the Python Global Interpreter Lock works, I can't guarantee this will work without trying it.
 
 Svar
	
	
	
		
	        Ikke en bug
		
	
	
	
	The command you're entering blocks the main thread while awaiting a reply from the main thread of the current process. By definition, this can't work.
	
	
In general, as commands entered via the console are run in the main thread of the Sublime Text process, there are many ways to cause harm to the process. The only alternative would be to run a sandboxed version of Python that couldn't interact with the system, which would not be desirable.
The above aside, you may be able to get the desired result running the command via a thread in a plugin. However, due to the way the Python Global Interpreter Lock works, I can't guarantee this will work without trying it.
Kundesupport af UserEcho
 Fejl
		
		
	
Fejl 
	
