Describe the issue
Under terminal emacs, the cursor shape is unchanged under both command and insert modes -- which leaves terminal emacs users confused at times.
The behavior is different under GUI Emacs. Even not many people use terminal Emacs, I'd think it is nice to correct the behavior.
Steps to reproduce
i to enter insert modeSystem information
emacs version 26.1
features XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2
build Feb 03, 2019
buildopts (--build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-26.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro)
windowsys nil
daemonp daemon
doom version 2.0.9
build HEAD -> develop 2d36c0f9a 2019-10-29 11:36:46 -0400
system type gnu/linux
config x86_64-pc-linux-gnu
shell /bin/zsh
uname Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2 (2019-08-28) x86_64
path (/usr/local/bin /usr/local/sbin /usr/bin /bin /usr/games /usr/lib/surfraw ~/.fzf/bin ~/02-computing/linux/bin ~/.local/bin ~/.emacs.d/bin /usr/lib/emacs/26.1/x86_64-linux-gnu)
config envfile nil
elc-files 0
modules (:completion company (ivy +fuzzy) :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold (format +onsave) multiple-cursors rotate-text snippets :emacs dired electric vc :term eshell term :tools eval flycheck (lookup +docsets) magit make tmux :lang cc clojure data emacs-lisp ess javascript markdown (org +dragndrop +ipython +pandoc +present) python sh :config (default +bindings +smartparens))
packages (n/a)
elpa (n/a)
Try installing https://github.com/7696122/evil-terminal-cursor-changer:
;; ~/.doom.d/packages.el
(package! evil-terminal-cursor-changer)
;; ~/.doom.d/config.el
(use-package! evil-terminal-cursor-changer
:hook (tty-setup . evil-terminal-cursor-changer-activate))
Cool... it works like a charm.
One question: is there a place we can contribute documents like putting little items like this together?
Any reason this is not in doom?
Any reason this is not in doom?
@magnetophon This isn't included in Doom because the package is no longer maintained, is unreasonably buggy and lacks support for a number of terminals (like mate-terminal, xfce4-terminal) as well as tmux. Where it isn't supported, it inserts extraneous characters into the buffer on cursor change. With decisions like these, I prefer the principle of least surprise. An unchanging cursor is less surprising. What's more, the config is trivial enough for people to install themselves.
One question: is there a place we can contribute documents like putting little items like this together?
@randomizedthinking How about https://github.com/hlissner/doom-emacs/blob/develop/docs/api.org#interesting-snippets ?
@hlissner OK, fair enough. Thanks!
Thanks, @hlissner. I will add this item in...
Just a heads up. As of 0a4841b Doom has a :os tty module. It includes clipboard integration (either xclip or clipetty -- see its docs), but it also installs evil-terminal-cursor-changer. I didn't want to add it as a core package, but as an opt-in module, I can leave it to the user to decide.
Hope that's helpful!
Most helpful comment
Just a heads up. As of 0a4841b Doom has a
:os ttymodule. It includes clipboard integration (either xclip or clipetty -- see its docs), but it also installsevil-terminal-cursor-changer. I didn't want to add it as a core package, but as an opt-in module, I can leave it to the user to decide.Hope that's helpful!