0

I want to be able to hide the mouse cursor programmatically. I am okay with giving any required permissions to the script.

Is this operation possible on macOS?

7
  • 2
    Can you explain a bit more about this requirement? Just to confirm, you mean the flashing line in a text block, not the pointer? Do you want to remove it globally from all apps, or just from one particular app? And you want to be able to restore it as well, preferably without a restart? How will you know where you're typing?
    – benwiggy
    Dec 23, 2023 at 10:53
  • I've made an edit on the assumption / comments that I feel is most logical @benwiggy - I don't think the OP wants to hide it in an app they are compiling or making.
    – bmike
    Dec 23, 2023 at 14:46
  • @bmike "without the foreground app performing the hiding"....? <Confused>
    – benwiggy
    Dec 23, 2023 at 14:52
  • 1
    @bmike Sounds like you're talking about the Pointer, not the Cursor...?
    – benwiggy
    Dec 23, 2023 at 16:25
  • 1
    @benwiggy I mean the mouse symbol, not the caret symbol in the text boxes.
    – HappyFace
    Dec 24, 2023 at 3:36

2 Answers 2

1

so what i just did was to download cursorcerer pref pane. then i unzipped it. then showed package contents. then simply double clicked the resource called cursorcerer.app. now my cursor is invisible -- even after moving. so you could call this app from the terminal. quite debilitating in my environment, but could be very helpful in others!

http://doomlaser.com/cursorcerer-hide-your-cursor-at-will/

i was able to get my cursor back by running the preference pane.

3
  • I have this app, but as you said, you can’t get the cursor back. And I think the app doesn’t work in the latest macOS.
    – HappyFace
    Feb 15, 2019 at 19:21
  • i wonder how he is doing it inside that app. i showed contents of that, but nothing i can pick apart Feb 15, 2019 at 19:27
  • The "how" is explained here, as linked from the product page mentioned in your answer.
    – nohillside
    Dec 23, 2023 at 9:40
-1

You can use applescript to set the cursor to the current background color of the terminal window:

tell application "Terminal"
    set invisibleColor to get background color of (get properties of (get startup settings))
    set properties of (get startup settings) to {cursor color:invisibleColor}   
end tell

Use osascript to execute applescript within a shell script.

2
  • 1
    I want to hide it for everything. The reason I want to do it from the terminal is to set a loop that continuously hides the cursor, as it becomes visible after moving it a little.
    – HappyFace
    Jan 14, 2019 at 8:06
  • The original Title was "Hide the cursor from the terminal". At the time the question could be understood this way. Mar 23 at 11:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .