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

Spacemacs -nw + Tilda + Zsh #2905

Closed
mekarpeles opened this issue Sep 6, 2015 · 6 comments
Closed

Spacemacs -nw + Tilda + Zsh #2905

mekarpeles opened this issue Sep 6, 2015 · 6 comments

Comments

@mekarpeles
Copy link

On Debian 9 alpha 2 (4.1.0-1-amd64 #1 SMP Debian 4.1.3-1 (2015-08-03) x86_64 GNU/Linux)

Scenario:
When running spacemacs with no windows (e.g. emacs -nw) when using the tilda terminal with (oh my) zsh.

Symptom(s):
The zsh session becomes corrupted and prints a strange string after each command: "[a q". Strange characters occasionally also appear within the spacemacs itself and interrupt the session.

Work-around:
If I modify my init.el as follows by excluding spacemacs/setup-after-init-hook (core-spacemacs.el) when run as -nw, the problem does not occur

(when (spacemacs/emacs-version-ok)
  (load-file (concat user-emacs-directory "core/core-load-paths.el"))
  (require 'core-spacemacs)
  (require 'core-configuration-layer)
  (spacemacs/init)
  (when window-system
    (spacemacs/setup-after-init-hook))  ;; fix: omitting this line when run as -nw
  (spacemacs/maybe-install-dotfile)
  (require 'server)
  (unless (server-running-p) (server-start)))
)
@beneyal
Copy link

beneyal commented Sep 6, 2015

I am experiencing the same symptoms.
Using Gnome Terminal with oh-my-zsh, the workaround suggested by @mekarpeles doesn't work for me.

This is how it looks after executing emacs -nw, pressing down until the 2nd recent file, and pressing right a few times. Note that this only happens visually, so if I edit a file, I see gibberish, but the content is what I typed.
screenshot-emacs -nw

@mekarpeles
Copy link
Author

Sorry @beneyal , I made a mistake, it appears to be happening during
(configuration-layer/load-layers) in core-configuration-layer.el which is called from init.el

If you change the line (configuration-layer/sync) in init.el to (configuration-layer/sync window-system) and then update core-configuration-layer.el configuration-layer/sync as follows, it should stop the problem (but also the spacemacs confics won't load):

(defun configuration-layer/sync (ws)
"Synchronize declared layers in dotfile with spacemacs."
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
(configuration-layer/init-layers)
(when (ws)
(configuration-layer/load-layers))
(when dotspacemacs-delete-orphan-packages
(configuration-layer/delete-orphan-packages)))

@grokful
Copy link

grokful commented Sep 7, 2015

I experienced similar symptoms, particularly severe from within tmux. I seem to have made the problem go away by disabling evil-terminal-cursor-changer.

@mekarpeles
Copy link
Author

@grokful -- you're right, updating spacemacs/packages.el to only setq
'evil-terminal-cursor-changer when window-system t fixed the issue for me.

I'm also running emacs -nw within tmux.

next-window(defun spacemacs/init-evil-terminal-cursor-changer ()
(unless (display-graphic-p)
(when (not window-system)
(require 'evil-terminal-cursor-changer)
(setq evil-visual-state-cursor 'box) ; █
(setq evil-inser<0;24;43m[t-state-cursor 'bar) ; ⎸
(setq evil-emacs-state-cursor 'hbar) ; _
)))

best wishes,

  • mek

On Mon, Sep 7, 2015 at 2:37 PM, grokful notifications@github.com wrote:

I experienced similar symptoms, particularly severe from within tmux. I
seem to have made the problem go away by disabling
evil-terminal-cursor-changer.


Reply to this email directly or view it on GitHub
#2905 (comment)
.

@JohnLunzer
Copy link

I have a similar problem, i'm using Gnome-Terminal and Tmux and Bash and when I make your change in the last post to my packages.el file it removes my ability to use the completion functionality and a host of other issues. Any idea what I'm doing wrong and do I need to make another change in addition to this one?

Also if I try to run emacs in a window now I cannot use the spacebar, it says end-of-buffer... any advice? I clearly have no clue what i'm doing.

@JohnLunzer
Copy link

Just an update, installing the develop branch fixed this and also when I checked packages.el and the "next-window" bit isn't there.

@TheBB TheBB closed this as completed Sep 30, 2015
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

5 participants