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

term-cursor doesn't work well with diff-hl #1

@AmaiKinono

Description

@AmaiKinono

Here's my config of term-cursor:

(use-package term-cursor
  :straight (:host github :repo "h0d/term-cursor.el")
  :if (not (display-graphic-p))
  :config
  (global-term-cursor-mode))

diff-hl is a package that highlights uncommitted changes on the left side of the window. Here's my config:

(use-package diff-hl
  :hook (after-init . global-diff-hl-mode)
  :config
  (diff-hl-flydiff-mode))

The problem is, when editing any file under version control, the cursor shows as a bar when entering insert state, but turns into a box after typing anything. I assume this is a problem of term-cursor since I didn't find any code in diff-hl that deals with cursor type.

Here's what I've tried to figure out the cause of the problem: I think what term-cursor essentially does is the send-string-to-terminal thing. So I disabled the package, and eval this manually in Emacs:

(send-string-to-terminal "\033[5 q")

Then the cursor turns into a bar, and the problem didn't show up after some test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions