Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:26:59+00:00 2026-06-14T16:26:59+00:00

How does one read a single keystroke from the terminal (not Swing) in Clojure?

  • 0

How does one read a single keystroke from the terminal (not Swing) in Clojure?

I have tried a few things including various versions of the JLine library, but have not gotten it working (see example below).

I will happily accept a working, Unix-only (Mac, Linux, …) example. Ideally I’d like to know how to switch buffering off for both stdin and stdout.

Here’s something close:

;; project.clj dependencies:
;; [[org.clojure/clojure "1.4.0"]
;;  [jline/jline "2.8"]])

(ns slosh.core
  (:import [jline.console ConsoleReader])
  (:gen-class))    

(defn -main []
  (println "start")
  (let [cr (ConsoleReader.)]
    (.readCharacter cr)
    (println "done")))

This prints “start” but does not respond to any input except control-C.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:27:01+00:00Added an answer on June 14, 2026 at 4:27 pm

    I’m not sure how you are running this, but if you are using lein run, you will run into problems. Try using lein trampoline run.

    I would link Single character console input in java/clojure but I don’t seem to have enough Internet Points to do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with WCF .NET 3.5 SP1 and have read that one does
I have an agreement with a company (read: one single company) who would like
Let's say I'm programming in a threading framework that does not have multiple-reader/single-writer mutexes
I've read a few things, including this and this , but I think the
How does one implement a multithreaded single process model in linux fedora under c
I have a single sign-on solution, meaning that the user will login to one
I want to learn about Eucalyptus cloud computing. I have read few documentation pages
I have read this post thoroughly: How does Visual Studio's source control integration work
In my application there are many cases where I have to update one single
How does one dynamically allocate either a single dimensional array or a two dimensional

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.