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

emacsclient --tty crashes immediately (regression) #5978

Closed
aaronjensen opened this issue May 4, 2016 · 6 comments
Closed

emacsclient --tty crashes immediately (regression) #5978

aaronjensen opened this issue May 4, 2016 · 6 comments

Comments

@aaronjensen
Copy link
Contributor

aaronjensen commented May 4, 2016

Description

I can no longer connect tty clients to a graphical emacs on osx. I bisected, and
this is the offending commit:

cf3068e

Because of its nature (it is simply re-enabling a hook that was disabled by an
upstream change), reverting the commit is probably not the right thing to do.

Reproduction guide

  • Start Emacs
  • Run emacsclient --tty something

Observed behaviour:
emacsclient starts and crashes immediately

This error appears in messages:

Error during redisplay: (eval (window-numbering-get-number-string)) signaled (wrong-type-argument hash-table-p nil) [2 times]

Expected behaviour:
emacsclient does not crash

System Info

  • OS: darwin
  • Emacs: 25.0.93.1
  • Spacemacs: 0.105.19
  • Spacemacs branch: nil (rev. cf3068e)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: helm
  • Layers:
(better-defaults spacemacs-helm emacs-lisp markdown
                 (syntax-checking :variables syntax-checking-enable-tooltips nil)
                 (auto-completion :variables auto-completion-enable-sort-by-usage nil auto-completion-enable-snippets-in-popup t)
                 erlang elixir git dash html clojure
                 (org :variables org-enable-github-support t)
                 colors osx github javascript react deft floobits ruby
                 (shell :variables shell-default-shell 'ansi-term shell-default-height 30 shell-default-position 'bottom)
                 spell-checking ranger version-control rcirc tmux evil-little-word auto-correct frame-geometry cleverparens-lispy)
aaronjensen referenced this issue May 4, 2016
persp-mode has renamed persp-activated-hook to
persp-activated-functions, so we gotta update the hook.
@aaronjensen
Copy link
Contributor Author

If this line is commented out:

(eyebrowse--load-window-config current-slot))
then everything works fine. I don't understand eyebrowse/persp well enough to go much further.

@syl20bnr @TheBB could I propose that this particular scenario (emacsclient --tty xxxx connecting to a gui emacs) be part of acceptance criteria for pull requests? This has broken at least twice and usually remains broken for a long time. It's a shame to disable this handy scenario.

@TheBB
Copy link
Collaborator

TheBB commented May 11, 2016

Probably prudent to ping @bmag on this one.

@bmag
Copy link
Collaborator

bmag commented May 11, 2016

@aaronjensen The bug also reproduces on my machine (Ubuntu 16.04). emacsclient starts and crashes immediately, leaving my terminal in a weird state, but I don't see any error message.

The Bug

I don't know why it happens, but I suspect it has something to do with persp-mode using the same nil-perspective for all(?) frames. Because persp-mode uses the same perspective for the terminal frame as for the graphical frame, we try to load a graphical window state (Eyebrowse workspaces are mainly a window state object) into a terminal frame, resulting in error. There is indeed an error if I manually load a graphical window state into a terminal frame, even in stock Emacs.

To sum it up: we can't use the same workspace on different frame types (graphical vs. terminal), but because the same perspectives are used in both frame types, and because we make workspaces perspective-local, the result is that we try to do exactly that. Specifically in @aaronjensen's case, the shared perspective is probably the default perspective.

Possible Solution 1

Make perspective local to a frame, IOW perspectives should not be shared between frames. I don't know if this is possible, and it will certainly make it harder for users who want to share perspectives between frames.

Possible Solution 2

Store two sets of workspaces as perspective parameters - one set for graphical frames, a second set for terminal frames. When loading workspace from perspective, load the correct one according to display-graphic-p. The persp params that we currently use:

(persp-parameter 'eyebrowse-window-configs))
(persp-parameter 'eyebrowse-current-slot))
(persp-parameter 'eyebrowse-last-slot))

will be replaced by:

;; for graphical frames
(persp-parameter 'gui-eyebrowse-window-configs))
(persp-parameter 'gui-eyebrowse-current-slot))
(persp-parameter 'gui-eyebrowse-last-slot))
;; for terminal frames
(persp-parameter 'term-eyebrowse-window-configs))
(persp-parameter 'term-eyebrowse-current-slot))
(persp-parameter 'term-eyebrowse-last-slot))

I think solution 2 is simpler and easier to implement/maintain than the other possible solutions.

Possible Solution 3

Same as solution 2, but instead of using just two sets, we use a distinct set for each frame (graphical or not).

@bmag
Copy link
Collaborator

bmag commented May 11, 2016

@aaronjensen can you test #6031? Terminal frames and graphical frames should have totally separate workspaces (but not separate layouts).

@aaronjensen
Copy link
Contributor Author

@bmag that works great, thank you!

@d12frosted
Copy link
Collaborator

Fixed with released of Spacemacs v0.200. Let us know if you still have any problems with this issue.

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

No branches or pull requests

6 participants