Skip to content
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

Copy menu command is disabled when emacs is running in a terminal #769

Open
tomb7890 opened this issue Feb 9, 2021 · 7 comments
Open

Copy menu command is disabled when emacs is running in a terminal #769

tomb7890 opened this issue Feb 9, 2021 · 7 comments

Comments

@tomb7890
Copy link

tomb7890 commented Feb 9, 2021

Hello Steve - when using this config with emacs -nw (sans window system), I cannot then use the terminal's edit/copy menu command to copy a selection of text to the clipboard. The menu command becomes greyed out. However, if I quit emacs, then the copy menu command is restored. Or, if I blow away emacs config with rm -rf ~/.emacs.d, copy functionality is restored to emacs sessions.

M-x version says: 'GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu) of 2021-02-08'. I get the emacs package from Homebrew for what that's worth. Problem exhibited on two Linux boxes and on a macbook pro under the iTerm terminal program. Changing Linux terminal applications has no effect on this problem.

Otherwise your config is excellent I really appreciate the work you have put into it. But this clipboard issue is a nuisance to me, I wonder if you would take a look.

Thanks

@purcell
Copy link
Owner

purcell commented Feb 10, 2021

Yeah, I think that's because the terminal emacs app itself supports clipboard terminal escape sequences. IIRC I've turned off xterm-mouse-mode in terminals previously so that when I select some text with the mouse, it's the terminal emulator controlling the highlight and selection rather than Emacs. But then of course there's no seamless copy/paste across Emacs/OS with Emacs keys.

@purcell
Copy link
Owner

purcell commented Feb 10, 2021

Maybe you'd like to try the osx-clipboard package and see if it helps.

@purcell
Copy link
Owner

purcell commented Feb 10, 2021

(For my part, I rarely use Emacs in a terminal, preferring a long-running GUI app. )

@purcell
Copy link
Owner

purcell commented Feb 10, 2021

Also the clipmon package looks promising, for Linux + MacOS support.

@tomb7890
Copy link
Author

Thanks Steve -- I've found a crude workaround by just commenting out (xterm-mouse-mode 1) in lisp/init-xterm.el.

Is there a way this could be made an option in a local dotfile or the like?

@purcell
Copy link
Owner

purcell commented Feb 16, 2021

Thanks Steve -- I've found a crude workaround by just commenting out (xterm-mouse-mode 1) in lisp/init-xterm.el.

Yeah, that would do it.

Is there a way this could be made an option in a local dotfile or the like?

I need to think about whether the current default is the best, but in the meantime you'd need to locally modify the config, or maybe putting (remove-hook 'after-make-console-frame-hooks 'sanityinc/console-frame-setup) in init-local.el would do the trick.

@tomb7890
Copy link
Author

tomb7890 commented Feb 16, 2021

Thanks Steve. Sounds like you have a better solution in mind so I will leave this open for now, but in the mean time, yes your suggestion of (remove-hook 'after-make-console-frame-hooks 'sanityinc/console-frame-setup) does the trick.

Maybe will be of use to other terminal users out there who are fans of your work. I can't be the only one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants