racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
444 stars 93 forks source link

"Kill" button is misleading #588

Closed sorawee closed 1 year ago

sorawee commented 1 year ago

After we click the "Stop" button, the label is changed to "Kill". This "Kill" seems to have a different meaning from Cmd+K (Force the Program to Quit), however. I'm not totally sure how they are different precisely, but I do know that, for example, clicking the "Kill" button won't invoke the kill-evaluation method, but Cmd+K will.

The different behavior is confusing and misleading. They should have the same behavior. Alternatively, there should be three different labels for these three different actions.

rfindler commented 1 year ago

I think it does actually shut the custodian down. Is there something else you're missing? Here's what I tried: with this in the definitions window:

#lang racket
(break-enabled #f)
(semaphore-wait (make-semaphore 0))

I hit run. Then I hit Break and the button label changed into Kill. Then I clicked Kill and the interactions window was reset. It looks like this is the code that gets invoked when that button is clicked (in either mode): https://github.com/racket/drracket/blob/master/drracket/drracket/private/unit.rkt#L1324

(FWIW, I think they should be doing the same thing, so we should probably change something to achieve that effect.)

sorawee commented 1 year ago

Right, and I see that Cmd+K also shutdowns custodians and doing more things, such as calling (clear-output-ports).

https://github.com/racket/drracket/blob/master/drracket/drracket/private/rep.rkt#L1297

Is it possible to override this kill-evaluation method by DrRacket extension? If so, that could cause another different behavior.

rfindler commented 1 year ago

Probably it makes sense to do those things in both cases (so call kill-evaluation when clicking on the break-button but it is in "kill" mode).