这是indexloc提供的服务,不要输入任何密码
Skip to content

7696122/terminal-cursor-mode

Repository files navigation

Terminal Cursor Mode

Emacs minor mode that changes cursor appearance in terminal based on cursor-type, with performance optimization, error handling, and buffer-local state tracking.

Features

  • Changes cursor shape (box, bar, hbar) based on cursor-type
  • Controls cursor blinking with blink-cursor-mode
  • Sets cursor color from cursor face
  • Performance optimized (updates only when state changes)
  • Buffer-local state tracking (no cross-buffer interference)
  • Error handling for unsupported terminals
  • Global mode for all buffers

Installation

(load-file "terminal-cursor-mode.el")
(global-terminal-cursor-mode 1)  ; Enable for all buffers

Usage

Global Mode (Recommended)

(global-terminal-cursor-mode 1)   ; Enable for all buffers
(global-terminal-cursor-mode 0)   ; Disable

Per-Buffer Mode

(terminal-cursor-mode 1)          ; Enable for current buffer
(terminal-cursor-mode 0)          ; Disable

Change Cursor Settings

(setq cursor-type 'bar)                              ; Bar cursor
(setq cursor-type 'box)                              ; Block cursor  
(setq cursor-type 'hbar)                             ; Underline cursor
(blink-cursor-mode 1)                                ; Enable blinking
(set-face-attribute 'cursor nil :background "red")   ; Set color

Requirements

  • Emacs running in terminal (emacs -nw)
  • Terminal supporting ANSI escape sequences

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published