switch-window icon indicating copy to clipboard operation
switch-window copied to clipboard

Window numbers are incorrect in daemon mode

Open seagle0128 opened this issue 7 years ago • 5 comments

Hi,

When I using emacsclient -a "" -nw to start Emacs as daemon, the window numbers are incorrect while switching window. It happens on GNU Emacs 26.1/27.0.50 with Ubuntu/Mint Linux/macOS.

Only two windows, but the numbers are 2 and 3 in the screenshot below. image

BTW, the numbers are correct in ace-window and winum.

seagle0128 avatar Oct 24 '18 07:10 seagle0128

I have tested in windows, seem to have no problem, please test by bare emacs, maybe it is a configure problem.

tumashu avatar Oct 27 '18 13:10 tumashu

It exists in the terminal on Linux and macOS. On Windows, there is not real daemon mode actually.

seagle0128 avatar Oct 27 '18 14:10 seagle0128

Here are the minimal steps which reproduce it for me. I'm running Windows 7 with Emacs 26.1.

I have switch-window installed. I have renamed my init.el so that it is not loaded.

  1. In cmd.exe, I run emacsclientw.exe -n -c -a ""
  2. In the default *scratch* buffer, I execute (require 'switch-window)
  3. I create several splits, C-x 2 C-x 3
  4. I try switching windows with C-x o

This produces the following:

switch-window

Pressing a has no effect.

dolorsitatem avatar Nov 20 '18 13:11 dolorsitatem

Here's a workaround when using the switch-window-qwerty-shortcuts. I imagine this can be extended to other shortcut setups.

It seems that the first shortcut is being lost somewhere. So, just throw a dummy one in there.

(setq switch-window-qwerty-shortcuts '("x" "a" "s" "d" "f" "j" "k" "l" ";" "w" "e" "i" "o")

My full setup is as follows:

(use-package switch-window
  :ensure t
  :bind
  ;; default C-x o is other-window
  ;; default C-x C-o is delete-blank-lines
  (("C-x o" . switch-window)
   ("C-x C-o" . switch-window))
  :config
  (setq switch-window-multiple-frames t)
  (setq switch-window-shortcut-style 'qwerty)
  (setq switch-window-qwerty-shortcuts '("x" "a" "s" "d" "f" "j" "k" "l" ";" "w" "e" "i" "o"))
  (setq switch-window-increase 3))

dolorsitatem avatar Nov 27 '18 17:11 dolorsitatem

I notice that the labeling of windows depends on the monitor the frame is on. I have 4 monitors. Say that I have 3 frames open with 4 windows total. I can have a frame on the far left monitor and it will be labeled "a". When I move that same frame to the far right monitor, it becomes ";". It skips several of the qwerty shortcuts:

  (setq switch-window-qwerty-shortcuts '("a" "s" "d" "f" "j" "k" "l" ";" "w" "e" "r" "u" "i" "o" "q" "t" "y" "p"))

dolorsitatem avatar Mar 19 '19 12:03 dolorsitatem