Hot answers tagged

6

The control sequences ^[[?2004h and ^[[?2004l turn bracketed paste mode on and off. Shell mode doesn't support bracketed paste mode (with these or any other control sequences), so zsh shouldn't try to turn it on. Shell mode correctly advertises that it doesn't support these control sequences by declaring TERM=dumb. It seems that zsh blindly assumes that the ...


4

Is it correct to assume that you're new to Emacs? If yes, are you aware of how Emacs manages windows and that the term 'window' does not refer to what you think it does? The concepts 'windows' and 'frames' are described on https://www.gnu.org/software/emacs/manual/html_node/elisp/Windows-and-Frames.html and (more from the user's perspective) on https://www....


3

You could try smartparens. With the settings below: Pressing [ SPC becomes [ | ] Pressing [ [ SPC becomes [[ | ]] Selecting foo and pressing [ becomes [ foo ] Pressing [ a second time becomes [[ foo ]] (require 'smartparens) (smartparens-global-mode 1) (show-paren-mode 1) (defun sp-shell-insert-spaces (_id action _context) (when (eq action 'wrap) (...


2

You want to look at sh-syntax-propertize-function where it currently uses the regexp "\\(?:[^|&;<>()``\\\"' \t\n]\\|\\${\\)\\(#+\\)" to match those # chars which should not be considered as starting a comment. If you remove the ( char in the char range (i.e. replace () with just )), then it should solve your particular problem. It will also cause ...


2

You can explicitly set which shell M-xshell uses by customizing explicit-shell-file-name If your zsh config causes problems with shell you might try M-x term or ansi-term instead which may play better with your config. If nothing quite works right, you could always use tmux or screen to flip between emacs and a real shell.


2

Your $PATH settings in your init file are not taken into account per default. Try the following: (add-to-list 'tramp-remote-path 'tramp-own-remote-path) See also the Tramp manual discussing this setting.


2

You should remove :defer f, because you don't want exec-path-from-shell to be defer loaded and you are going to use function from it when Emacs starts. Try something like the following (use-package exec-path-from-shell :ensure t :if (memq window-system '(mac ns x)) :config (setq exec-path-from-shell-variables '("PATH" "GOPATH")) (exec-path-from-...


2

Answering my own question; I had a server running that I was not aware of. brew services list After stopping it with brew services stop emacs-plus or brew services stop emacs, I was able to configure the EDITOR with export EDITOR="emacsclient" to use the Emacs.app GUI as the server from the shell.


1

If sh-use-smie is set to t the Simple Minded Indentation Engine (SMIE) is used for indentation. As you experience, the sh-mode setup for SMIE does not cover all the alternate complex commands of zsh yet. Note that those forms should not be used in new programs. I cite the zsh doc: These are non-standard and are likely not to be obvious even to seasoned ...


1

Yes. An alias to the binary within Emacs.app is useful and will allow to call an up-to-date version of emacs from the terminal via “emacs”. I have the following set up alias emacs='$(/Applications/Emacs.app/Contents/MacOS/Emacs "$@")'


1

Absolutely. Turn on shell-script-mode/sh-mode in the scriptfile buffer, perhaps switch to zsh with C-c : for sh-set-shell (could change the first line of your script), and maybe mark some lines and press C-c C-n for sh-send-line-or-region-and-step - this did not switch to a re-used shell-buffer in the other window in my experiments. I can't figure out how to ...


1

I found the problem. As I mentioned in the ticket, I was setting the variable EMACS myself in .zshenv to help setup PATH. As it happens termsupport.zsh also uses this variable name internally. All I had to do is rename my own variable to something else, and it all now works.


1

Are $TERM environment variables same value ? If its value is different from each other. It causes different looking.


Only top voted, non community-wiki answers of a minimum length are eligible