Fork me on GitHub
#emacs
<
2022-05-24
>
otfrom07:05:18

later I shall be asking important questions about bikeshed colours

sheepy 3
mario-star 1
1
enn20:05:06

I recently upgraded Emacs and now I’ve been getting stray control characters inserted into my buffers in terminal (`-nw`) mode, I think based on mouse events. Sometimes (as in this example) the cursor jumps to the beginning of the buffer before the characters are inserted, sometimes not. Has anyone else run into this? I use xterm-mouse-mode and iterm2 on MacOS.

enn20:05:54

I have this config snippet which I’ve used for years to get the scroll wheel working

(global-set-key [mouse-4] '(lambda ()
                            (interactive)
                            (scroll-down 1)))
(global-set-key [mouse-5] '(lambda ()
                            (interactive)
                            (scroll-up 1)))

Cora (she/her)21:05:07

scrolling the mouse sends M-[

Cora (she/her)21:05:10

to the terminal

enn21:05:45

yeah, seems pretty similar to what I have

enn21:05:33

to clarify, all of my mouse interactions still work (clicking to move the cursor, dragging to select, and scrolling with the mouse wheel). It’s just that sometimes I also get these random inserted characters. It’s possible that the mouse is a red herring and that these chars are coming from somewhere else.

Cora (she/her)21:05:37

well I guess all I see are your bindings so if you say so then it probably is

Cora (she/her)21:05:25

35 is the foreground magenta color code

Cora (she/her)21:05:42

and 25 would be blinking?

Cora (she/her)21:05:10

well no it's the reset code for blinking

enn21:05:15

oh, interesting!

Cora (she/her)21:05:04

unless it's true color in which case it could be part of an rgb

enn21:05:06

I wonder if there’s a bug in my color theme. I might try another to see if I have the same problem there. Thank you, that is a really helpful thread for me to pull on.

Cora (she/her)21:05:27

I hope it helps!

Cora (she/her)21:05:57

I wonder if it's cursor change escape sequences. do you use evil mode?

enn21:05:08

no, I don't

Cora (she/her)22:05:23

spacemacs doesn't have much either fwiw