Christian Ebert committed 8bb2609

pybrowser: disable browser check on open in cygwin

BROWSER='/cygdrive/c/Program Files (x86)/Mozilla Firefox/firefox.exe'
works on cygwin, but returns False in

  • Participants
  • Parent commits 04e472c
  • Tags 1.3

Comments (0)

Files changed (1)

File muttils/

                 url = 'file://' + url
         return url
-    def cygpath(self, tb):
+    def cygpath(self, tb, cygwin):
         '''Do we have to call cygpath to transform local path to windows file
         system path?'''
-        if not util.cygwin() or tb:
+        if tb or not cygwin:
             return False
         return ('/cygdrive/') == 0 and
       '/Cygwin/') < 0)
     def urlvisit(self):
         '''Visit url(s).'''
         textbrowsers = 'w3m', 'lynx', 'links', 'elinks'
-        notty, screen = False, False
+        notty, screen, cygwin = False, False, util.cygwin()
         tb = self.appname in textbrowsers
         if tb:
             notty = not util.termconnected()
             screen = 'STY' in os.environ
-        cygpath = self.cygpath(tb)
+        cygpath = self.cygpath(tb, cygwin)
         if not self.items:
             self.items = [self.ui.configitem('net', 'homepage')]
         self.items = [self.fixurl(url, cygpath) for url in self.items]
                 util.systemcall([, url], notty, screen)
             for url in self.items:
-                if not
+                if not and not cygwin:
                     # BROWSER=invalid gives valid
                     # webbrowser.GenericBrowser instance
-                    # and returns False
+                    # but returns False
+                    # disable check for cygwin as valid
+                    # graphical browser instances return False too
                     raise PybrowserError