[PATCH] util: add Mac-specific check whether we're in a GUI session (issue2553)

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Mar 23 11:13:07 CDT 2011


On Mar 23, 2011, at 5:00 AM, Mads Kiilerich wrote:

> On 03/23/2011 09:46 AM, Dan Villiom Podlaski Christiansen wrote:
> ...
> 
>> diff --git a/mercurial/util.py b/mercurial/util.py
>> --- a/mercurial/util.py
>> +++ b/mercurial/util.py
>> @@ -769,7 +769,18 @@ def splitpath(path):
>> 
>>  def gui():
>>      '''Are we running in a GUI?'''
>> -    return os.name == "nt" or os.name == "mac" or os.environ.get("DISPLAY")
>> +    if sys.platform == 'darwin':
>> +        if 'SSH_CONNECTION' in os.environ:
>> +            # handle SSH access to a box where the user is logged in
>> +            return False
> 
> Hardcore Mac users don't use X and forwarding over ssh?

Note that this check only applies if your merge tool is configured with .gui=True. If you're using a Mac and forwarding X over SSH, presumably you can also set .gui=False for your favorite merge tool.

All that said, I consider myself a pretty hardcore Mac user, and I never forward X over SSH. I use Remote Desktop (which is really just VNC).

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock



More information about the Mercurial-devel mailing list