#28330 closed defect (fixed)

Cygwin: Use cygstart instead of rundll32 to open files/websites

Reported by: embray Owned by:
Priority: major Milestone: sage-8.9
Component: porting: Cygwin Keywords: cygwin, browser
Cc: slelievre Merged in:
Authors: Erik Bray Reviewers: Samuel Lelièvre
Report Upstream: N/A Work issues:
Branch: 0a618c5 (Commits) Commit: 0a618c5b6a5cd94f41201b43b18b52ec03a8dad8
Dependencies: Stopgaps:


Cygwin includes a program called cygstart which is effectively like the open program, in that it will open URLs in the system's default browser, and will open files, given a file path, in the default application registered for files of that type (if any).

This is similar to the existing hack that was added to sage some time ago of calling rundll32.exe directly. Unfortunately, this is approach appears to be broken on modern Windows, and/or invokes a User Access Control dialogue asking the user to grant permission to "Make changes to your computer" which, while misleading, is somewhat threatening and/or disconcerting when just trying to open a file.

cygstart gets around all this.

In the Windows installer for Sage, I already add BROWSER=cygstart to the default environment, so it's not usually a serious problem. But better to also fix this in the code.

Change History (3)

comment:1 Changed 11 months ago by embray

  • Authors set to Erik Bray
  • Branch set to u/embray/cygwin/ticket-28330
  • Cc slelievre added
  • Commit set to 0a618c5b6a5cd94f41201b43b18b52ec03a8dad8
  • Status changed from new to needs_review

New commits:

0a618c5Trac #28330: On Cygwin, use cygstart instead of rundll32 to open URLs and files

comment:2 Changed 11 months ago by slelievre

  • Keywords changed from cygwin browser to cygwin, browser
  • Reviewers set to Samuel Lelièvre
  • Status changed from needs_review to positive_review

Using py2-based or py3-based Sage built from source in Cygwin on Windows 7, and running:

sage: tutorial()
  • before this ticket: nothing happens
  • after this ticket: the html page for the tutorial opens in the default browser

This is very nice! Positive review.

comment:3 Changed 11 months ago by vbraun

  • Branch changed from u/embray/cygwin/ticket-28330 to 0a618c5b6a5cd94f41201b43b18b52ec03a8dad8
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.