-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable evil-escape by default #6936
Comments
This is a side-effect of evil-escape on terminals. Duplicate of #5268 |
Yeah, you should probably paste from the clipboard instead of streaming characters in the terminal. That will usually not end well. Note that Emacs can't access the system clipboard when running in terminal mode though. May just be one of those things that you have to stomach. |
Are you sure it is a good idea to have this enabled by default? It's certainly surprising to have characters eaten from the middle of a base64 encoded string in a URL (which is what happened to me), and I've never heard of this feature before. Note that this also has quite obvious security implications. If pasted text can run arbitrary commands, you must never paste text you do not trust or have audited... |
Pasted text can't run arbitrary commands. Streamed characters into the terminal can, and they can do that regardless of what you're running. Try opening vim, going to insert state and then pasting If you have xclip installed, here's a hack that allows Emacs (at least, evil) to access the X clipboard(s). I don't know if it works with the standard Emacs copy/paste. (defun bb/x-get-selection (orig-fun &optional type data-type)
(condition-case nil
(funcall orig-fun type data-type)
(error
(when (and (executable-find "xclip")
(memq type '(PRIMARY CLIPBOARD)))
(let ((type (if (eq 'PRIMARY type) "primary" "clipboard")))
(shell-command-to-string
(format "xclip -selection %s -o" type)))))))
(advice-add 'x-get-selection :around 'bb/x-get-selection) |
But a terminal can help you there; xterm and gnome-terminal won't let you paste many control characters (like ESC). (To my dismay, I realized konsole does let them through.) Also getting such strings to the clipboard via a web page is probably much more difficult than getting a string containing "fd" there. |
Yep, all true. If there's widespread support for disabling evil-escape by default, we can discuss it, but I don't expect there to be. |
One option might be to disable it only when running in terminal mode? |
Doesn't |
Yeah, it should. How easily accessable is it? |
Well, I did nothing to set things up and haven't encountered a problem since using |
Just asking because I don't see any functions by that name. |
The plot thickens: Tried the repro steps on Emacs 25.1-rc2, develop branch, hybrid editing style, gnome-terminal. Encountered the expected behavior, no bug. Then I tried with vim editing style instead of hybrid, and I encountered the bug. As for bracketed-paste, the package isn't used in Emacs 25.1. From (setq spacemacs-editing-packages
'( ;; ... snipped ...
(bracketed-paste :toggle (version<= emacs-version "25.0.92"))
;; ... snipped ...
)) |
Something on our side is causing the trouble. With this repro I see no bug:
(require 'evil)
(require 'evil-escape)
(evil-mode)
(evil-escape-mode)
Observed behvaior: (the numbering is supposed to be 1,2,3,4 of course, not 1,2,1,2, but GitHub is acting dumb and stubborn) |
This doesn't seem to happen with emacs 25.2.1 with vim editing style. Typing fd quickly will take me back to normal mode but I can paste mkfd just fine. I'm on macOS running spacemacs through iTerm 2. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Description
When spacemacs is open in a text terminal (emacs -nw at least in either konsole or gnome-terminal) and in insert mode, using the terminal's paste feature to paste the text
mkfd
from X clipboard results in onlymk
being inserted. This does not happen with vanilla emacs (emacs -nw -q) nor in spacemacs in windowed mode (emacs without -nw).Reproduction guide
emacs -nw
in konsole or gnome-terminalq
to close the splash screeni
to enter the insert modemkfd
and copy it to clipboardmkfd
Observed behaviour:
Text
mk
is inserted.Expected behaviour:
Text
mkfd
is inserted.System Info
The text was updated successfully, but these errors were encountered: