[SOLVED] Why CIDER auto closed after I closed seesaw window?

Bellowing is the steps to reproduce the problem:

  1. generate seesaw project template

    lein new hello-seesaw
    

    <data/code/hello-seesaw/project.clj>

  2. Add seesaw to Leiningen project.clj

    (defproject hello-seesaw "0.1.0-SNAPSHOT"
      :description "FIXME: write description"
      :url "http://example.com/FIXME"
      :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
                :url  "https://www.eclipse.org/legal/epl-2.0/"}
      :dependencies [[org.clojure/clojure "1.10.1"]
                     [seesaw "1.5.0"]]
      :repl-options {:init-ns hello-seesaw.core})
    
  3. Now load project source files with CIDER and evaluate the -main function in src/hello_seesaw/core.clj file:

    (ns hello-seesaw.core
      (:use seesaw.core))
    
    (defn -main [& args]
      (invoke-later
       (-> (frame :title "Hello",
                  :content "Hello, Seesaw",
                  :on-close :exit)
           pack!
           show!)))
    
  4. It displays seesaw window, I closed it. Then CIDER REPL buffer displays red message reports that CIDER is closed.


CIDER version: 0.26.1
Emacs version: 28.0.50

You set the :frame to :on-close-exit, which means that (System/exit 0) will be invoked when the window closes. This is a typical setup if you have a pure gui app where closing the window means exiting the program. You don’t want this during repl development, so use a different option, :hide, :dispose, :nothing. You probably want :dispose

I see, thanks very much! @joinr :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.