term-cursor.el icon indicating copy to clipboard operation
term-cursor.el copied to clipboard

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

Open AmaiKinono opened this issue 6 years ago • 0 comments

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.

AmaiKinono avatar Jan 02 '20 18:01 AmaiKinono