Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrRacket starts up and opens a *.rkt file, but not the 2nd *.rkt file from File Explorer (Windows 10) #456

Closed
formalizm opened this issue Jan 22, 2021 · 11 comments

Comments

@formalizm
Copy link

I've upgraded Racket from 7.7 to 7.9 (default, not CS version) and I get this problem. I'm using Windows 10.

When DrRacket is not running and I start a *.rkt file from File Explorer or similar, it starts up normally and shows the file. So, the association of *.rkt with DrRacket is OK.

However, after DrRacket is already started and running, any other *.rkt file triggered via File Explorer does not work, DrRacket does not open another tab. (While it opens files OK via File -> Open menu).

I'm not sure how to diagnose the problem. I've tried the menu View -> Show Log and enabled all debug messages, but I don't see anything relevant there when I try to open a new file.

@formalizm
Copy link
Author

I've downgraded to 7.8 - the same issue, the 2nd file is not opening. Then I've downgraded to 7.7, the issue is gone, files are opening normally. Hence, this issue was introduced with version 7.8.

@jackfirth
Copy link
Collaborator

Seems like this issue would be better in the racket/drracket repository, but I don't have the permissions needed to transfer the issue. Could someone else transfer this issue?

@shhyou shhyou transferred this issue from racket/racket Jan 24, 2021
@jackfirth jackfirth added the bug label Jan 24, 2021
@rfindler
Copy link
Member

It is probably an issue in the racket/gui layer, technically (but it seems fine to leave the issue here until we know for sure).

@shhyou
Copy link
Collaborator

shhyou commented Jan 28, 2021

Looks like this is also reported as racket/gui#200 and racket/gui#139.

@default-kramer
Copy link

For what it's worth, I just upgraded from 7.9 to an 8.x snapshot, specifically version 8.0.0.11--2021-03-15(c0cfd32/a), and I'm very happy to see this is fixed now.

I think the specific error in racket/gui#139 has been fixed since 2019, so I closed that one.

I think this issue and racket/gui#200 are recently fixed with 8.0.

@MrYossu
Copy link

MrYossu commented May 27, 2021

@default-kramer I'm using 8.1 and have the same problem, so it doesn't look like it's been fixed.

@formalizm
Copy link
Author

The issue is still present in 8.2.

@default-kramer
Copy link

Just upgraded from my snapshot to 8.2 and was reminded of this bug. The following summary might be useful for someone who tries to fix this (and that someone might be me, in a short while)

  • 7.7 - no bug (formalizm)
  • 7.8 - bug (formalizm)
  • 7.9 - bug (formalizm, default-kramer)
  • 8.0.0.11--2021-03-15(c0cfd32/a) - no bug (default-kramer)
  • 8.1 - bug (MrYossu)
  • 8.2 - bug (formalizm, default-kramer)

@default-kramer
Copy link

default-kramer commented Oct 1, 2021

Did a little bit of investigation today. The file https://github.com/racket/drracket/blob/master/drracket/drracket/drracket.rkt seemed to be the entry point of DrRacket, but it is not. I added a println near the top and both 7.7 and 8.2 printed it the first time they opened a file, but not when the 2nd file was requested. As expected, 7.7 worked and 8.2 did not.

A little more exploring found the -singleInstance option. Found do-single-instance/gtk in https://github.com/racket/gui/blob/master/gui-lib/mred/private/wx/gtk/unique.rkt and followed it to the application-file-handler which is the mechanism used to pass the command-line arguments to the primary single instance. Following that leads to this line

(application-file-handler
where DrRacket installs its own application-file-handler. Confirmed that 7.7 does handle "open the 2nd file" via this mechanism, but in 8.2 the application-file-handler is never called.

I was was able to create a minimal repro of the root cause: racket/gui#245

@default-kramer
Copy link

Looks like the fix for racket/gui#245 worked and this bug is no longer present in 8.3! Can anyone else confirm? Then we can close this issue and racket/gui#200

@formalizm
Copy link
Author

I do confirm. The issue is fixed with DrRacket 8.3. I've checked it on the same machine as this issue was reported (win10).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants