DEV Community

Cover image for Avoid Typing Terminal Commands with the Wrong Input Method on macOS — CursorTint
fix
fix

Posted on Edited on

Avoid Typing Terminal Commands with the Wrong Input Method on macOS — CursorTint

A Common Input Mistake in Terminal

When using Terminal on a Mac, I sometimes make small but annoying typing mistakes:

  • git → ぎt
  • grep → gれp
  • brew → bれw

This happens when I start typing a command while Japanese input is still active.

I think I'm using an English input source, such as U.S. or ABC, but Japanese input is actually selected. I then have to switch input sources and type the command again.

It's not a serious problem, but it becomes frustrating when it happens repeatedly.

To reduce these mistakes, I created CursorTint, a small, free, open-source macOS app.

What Does CursorTint Do?

When you launch CursorTint, it runs in the background with an icon in the menu bar.

In Terminal, the cursor keeps its normal color when one of these input sources is selected:

  • U.S.
  • ABC
  • ABC Extended

When any other input source is selected, the cursor changes to a reddish color.

This lets you tell at a glance whether you're using one of the supported English input sources or another input method, such as Japanese, Chinese, or Korean.

Because you're already looking near the cursor while typing commands, there's no need to look up at the menu bar to check the current input source.

When you quit CursorTint from the menu bar, the cursor returns to its normal color.

Installation

  1. Download the latest ZIP file from GitHub Releases.
  2. Extract the ZIP file and copy CursorTint.app to your Mac's Applications folder.
  3. Double-click CursorTint.app to launch it.

No configuration is required.

To uninstall CursorTint, quit the app and delete CursorTint.app from the Applications folder.

Optional Recommended Settings

For better visibility:

  • In Terminal.app, open Settings → Profiles → Text. Choose a cursor color other than red and set the cursor shape to Block.
  • Consider using just one English input source (U.S., ABC, or ABC Extended) and one other input source you regularly use. This keeps input switching simple.

Does CursorTint Monitor What You Type?

One concern with this kind of utility is whether it reads or records keyboard input.

CursorTint does not read or store the characters you type.

It checks the currently selected input source and sends a control sequence to Terminal to change the cursor color.

It does not perform network communication.

System Requirements and Compatibility

  • macOS 12 or later
  • Designed for Apple's Terminal.app
  • Other terminal applications may work if they support OSC 12
  • Tested on Apple Silicon Macs
  • Distributed as a Universal Binary (not tested on a physical Intel Mac)

Tested Input Sources

  • Apple's built-in Japanese input method
  • Kawasemi 4 (Japanese input method)
  • Apple's built-in Chinese Pinyin input method
  • Apple's built-in Korean 2-Set input method

Final Thoughts

CursorTint is a very small utility, but once you start using it, the visual feedback can feel so natural that you may wonder why Terminal doesn't provide something similar by default.

If you've ever accidentally typed commands while another input method was active, CursorTint might help reduce those little frustrations.

CursorTint is free and open source.

GitHub: CursorTint Repository

This article is an English adaptation of my original Qiita article.

Top comments (0)