spacemacs gui lagging on close while saving clipboard - clipboard

When closing spacemacs with SPC q s or SPC q q. Often the emacs GUI will display the message "Saving Clipboard to X Clipboard Manager". Then it will not close.
Interestingly, this does not occur when using terminal emacs emacs -nw.
The clipboard on my os is Xfce Clipman. I'm thinking perhaps the emacs is assuming there is a different clipboard and performing an inappropriate operation.
I'm not sure how to debug this, because emacs is frozen when this is happening. Any suggestions as to how I can resolve this issue?
not responding while saving clipboard

Had this same issue. As seen in the Emacs documentation, you can stop this by disabling interaction with the clipboard manager.
(setq x-select-enable-clipboard-manager nil)

Related

restoring standard emacs key binding effectiveness in VSCode Terminal window

I periodically get thrown into the emacs editor in vscode, when I issue git commands.
For example, I'd like to edit the commit message for git, but the standard emacs key sequence ctrl-X ctrl-C is not accepted in the terminal window. This makes it difficult to exit emacs in the standard way.
I assume it's not being sent because MacOS or VSCode is intercepting the key combination.
I also assume that if MacOS was intercepting a two-keystroke combination, I would have noticed when running emacs on the MacOS terminal program (Unix shell prompt)

why command is canceled when I move terminal window on ubuntu?

everyone!
I installed ubuntu on vmware for working laravel framework.
I have problem with terminal.
when I move terminal window using mouse, running command is canceled.
Please see this...
hkg328#hkg328-virtual-machine:~$ ^C
hkg328#hkg328-virtual-machine:~$ ^C
hkg328#hkg328-virtual-machine:~$ ^C
hkg328#hkg328-virtual-machine:~$ ^C
whenever I move terminal window using mouse, following line appears in terminal.
hkg328#hkg328-virtual-machine:~$ ^C
What is the reason?
What should I do for solving this problem?
(When I move terminal using shift key+mouse drag It is ok.
But I don't want to use shift key.)
Thank you.
The likely problem is that your terminal has the xterm mouse-protocol enabled (usually from running some text-editor). Occasionally that does not clean up after itself (a problem with vim's plugins), and you'll even see this enabled on the shell command-line.
When you click in the text-area without shifting, that sends escape characters (and control characters) when xterm mouse-protocol is enabled. For xterm, at least, clicking/dragging the window border (including title area) shouldn't pass those escape/control characters to the application.
The use of the shift-key is built into the mouse protocol; if it's enabled you'll get that behavior -- always.

Mac sending weird keystrokes in terminal

Quite often but not always I'd receive some strange keystrokes in my terminal(OS X El Capitan). It looks like a sequence of:
^[[O^[[I
^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^C
this is so annoying especially when I have vim open it seems to bring up identifier search and I have to hit Enter to continue each time. I can verify this happens in iterm2 as well.
Did this ever happen to anyone else?
Those are an artifact of the changes in El Capitan to support xterm-style mouse protocol. The odd characters can tell a program when the mouse has moved in/out of the window (or clicked to gain/lose focus).
Some application you have run turns on this feature without handling it properly (or stopping it when the application ends).
Further reading:
FocusIn/FocusOut (XTerm Control Sequences)
Mouse Tracking (XTerm Control Sequences)

configuring emacs keys on mac os x

I've attached an external keyboard to my laptop and I've modified my keyboard mappings such that
1. Ctrl is CAPS
2. CAPS is Ctrl
I want to continue using the right Ctrl key as Ctrl instead of CAPS. Any pointes on how this can be achieved ?
I'm not at my mac right now so I might get this wrong, but...
Take a look at the group of variables named like ns-right-control-modifier, they control how the left and right modifier keys should behave.
You might need a recent version of Emacs to get full support.
I know this might be a little orthogonal to your problem, but I would sugget running emacs in iTerm 2 with emacs -nw
I say this because then in iTerm you have a little more control over the rebinding of the modifier keys by going to iTerm -> Preferences -> Keys. There you can remap both left and right keys.
I also suggest running emacs in the terminal because then if you use a terminal multiplexer like tmux or screen you have the ability to copy and paste from a terminal window right into your emacs buffer.

Scrolling inside Vim in Mac's Terminal

I've been googling around trying to figure out if it's possible to use my mouse wheel to scroll while inside Vim in Mac's Terminal, with no luck. It seems as if only X11 or iTerm support this.
Before I give up, I thought I'd try the geniuses here to see if anyone knows a way to do this. So, does anyone know if I can set that up?
Or should I seriously consider using a different terminal application?
And if you're using iTerm, add this to your vimrc
:set mouse=a
http://bitheap.org/mouseterm/
Use MouseTerm (and do make sure to install SIMBL first!) and scrolling will work like a charm, even remote, using Mac Terminal.
You need to fully quit the Terminal application (Command+Q) and then launch it again after installing MouseTerm.
This is an old question, but a top hit on google, so I feel compelled to provide an updated answer.
Running OSX El Capitan 10.11, vim mouse and trackpad scrolling just worked(TM) for me in Terminal.app by default. However occasionally the mouse/trackpad input stopped manipulating the vim buffer, and started scrolling the terminal buffer. The answer was Command+R or Menu View --> Allow Mouse Reporting. Turning that on allowed the mouse/trackpad scroll operations to move the cursor in vim.
Termanal Menu > View > Allow Mouse Reporting
Terminal Menu > Preferences >
Keyboard > Scroll alternate screen
If the mouse functionalities still do not work properly take a look at my answer in this post How to let vim behave on Mac OS X as on Ubuntu?, just add to your .vimrc
set ttymouse=xterm2
You can read this article, but I'm pretty sure since the default terminal in Mac OS X has a built-in scrollbar, the mousewheel commands automatically go to it. You could definitely use gVim as suggested in the previous answer. I find that I don't generally want to use the mouse in Vim though as it takes my hands off the keyboard.
I just use 50j to go down and 50k to go up. Not exactly scrolling, but it works pretty well.
Make sure the terminal is xterm & not ansi in Terminal Menu > Preferences > Profiles > Advanced. I accidentally broke scrolling by changing the term type in a naive effort to get coloring to work over ssh.
Use gVim, which gives you a text editing environment in a window you can scroll. Terminal is not involved when using gVim.
I'm using xterm in X11 (XQuartz 2.3.4) and vim works very fine with mouse and also suport 256 colors.
Here is the ~/.Xresources I use to make my xterm nicer in X11:
XTerm*faceName: Lucida Sans Typewriter Regular
XTerm*faceSize: 9
XTerm*utf8: 1
xterm*saveLines: 1000
xterm*jumpScroll: true
!xterm*awaitInput: true
!xterm*multiScroll: true
XTerm*scrollBar: false
xterm*scrollbar*thickness: 16
xterm*rightScrollBar: true
XTerm*foreground: white
XTerm*background: grey10
!XTerm*background: black
XTerm*cursorColor: yellow
xterm*visualBell: false
xterm*loginShell: true
Little tips, to remove the bell sound in X11's xterm type this command:
xset b 0
I would recommend using iTerm - it has so many advantages over Terminal eg Mouse support, 256 colors, sensible copy and paste (auto-copy, word/url selection with double click, middle click paste)...
When using iTerm create a .vimrc file (if not already there) in your home folder and add the line:
:set mouse=a
Scrolling down in vim to view a file works after this.

Resources