0

GNU Emacs 27.2 in Mac OS terminal (11.4 Big Sur).

Started with

(windmove-default-keybindings)  

and found that S-<up> and S-<down> behaved just as <up> and <down>, as if the shift is not detected, whereas S-<left> and S-<right> behaved as expected.

Tried

(define-key global-map (kbd "S-<up>") 'windmove-up)
(define-key global-map (kbd "S-<down>") 'windmove-down)

and there was no change in behavior.

Saw this: Windmove-mode: S-up and S-down becomes text selection instead of switching windows and tried adding

(setq shift-select-mode nil)

(even though S-<up> and S-<down> were not acting to select), and again, no change in behavior. windmove works correctly with S-<up> and S-<down>, but not for S-<left> and S-<right>.

Complete, minimal .emacs file:

; (windmove-default-keybindings)
(define-key global-map (kbd "S-<up>") 'windmove-up)
(define-key global-map (kbd "S-<down>") 'windmove-down)
(define-key global-map (kbd "S-<left>") 'windmove-left)
(define-key global-map (kbd "S-<right>") 'windmove-right)

(setq inhibit-startup-message t)
(load-theme 'wombat)
(menu-bar-mode -1)
0
1

Programs running in the terminal can’t receive a lot of key combinations. Shifted arrow keys are just one more example in a long list. Run the Emacs gui instead.

You can see this in action by using C-h k, then pressing a key combination. Emacs will tell you what it received and what command it would invoke.

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .