Closed tabuchid closed 2 years ago
Hello @tabuchid 👋
Outside of tmux, what happens when you launch
$ $EDITOR ~/.tmux.conf.local
?
My expectation is that you're going to get
$ zsh: command not found: emacsclient -t
Because by default Zsh doesn't do word splitting on variable expansion
Can you also please do
$ ls -l /bin/sh
?
Hello @gpakosz 👋🏼 Thanks for the response and thank you for this excellent project.
My expectation is that you're going to get
$ zsh: command not found: emacsclient -t
Because by default Zsh doesn't do word splitting on variable expansion
Ah hah, That is indeed what I'm seeing
Can you also please do $ ls -l /bin/sh
❯ ls -l /bin/sh
-rwxr-xr-x 1 root wheel 150384 Jul 14 10:48 /bin/sh
What I don't understand so far is that new-window
is supposed to execute commands with /bin/sh
and I'm wondering if /bin/sh
on your system is also Zsh?
Does the following open Emacs?
$ sh -c "$EDITOR"
Does the following open Emacs?
$ sh -c "$EDITOR"
It does.
After some googling about word splitting I've also confirmed that
${=EDITOR} ~/.tmux.conf.local
opens emacs.
What I don't understand so far is that
new-window
is supposed to execute commands with/bin/sh
and I'm wondering if/bin/sh
on your system is also Zsh?
It doesn't appear so.
❯ /bin/sh --help
GNU bash, version 3.2.57(1)-release-(x86_64-apple-darwin21)
Usage: /bin/sh [GNU long option] [option] ...
/bin/sh [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--restricted
--verbose
--version
--wordexp
Shell options:
-irsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
Type `/bin/sh -c "help set"' for more information about shell options.
Type `/bin/sh -c help' for more information about shell builtin commands.
Use the `bashbug' command to report bugs.
I'm not sure if its portable or not, assuming not, but this works locally for me.
diff --git a/.tmux.conf b/.tmux.conf
index a23bdad..feb8d04 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -26,7 +26,7 @@ setw -q -g utf8 on
set -g history-limit 5000 # boost history
# edit configuration
-bind e new-window -n "~/.tmux.conf.local" "EDITOR=\${EDITOR//mvim/vim} && EDITOR=\${EDITOR//gvim/vim} && \${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\""
+bind e new-window -n "~/.tmux.conf.local" "EDITOR=\${=EDITOR//mvim/vim} && EDITOR=\${=EDITOR//gvim/vim} && \${=EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\""
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
${=EDITOR}
is not portable.
Can you try
bind e new-window -n "~/.tmux.conf.local" "EDITOR=\${EDITOR//mvim/vim} && EDITOR=\${EDITOR//gvim/vim} && sh -c \"\${EDITOR:-vim} ~/.tmux.conf.local\" && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\""
please?
I pushed the gh-591
branch that should work for you
Branch gh-591
works!
Thank you @gpakosz! This has been a pleasure and I really appreciate the project.
When run
C-a e
I'm seeing the screen flash and thats it. Expecting~/.tmux.conf.local
to open in whats set as $EDITOR. I can confirm this works when I unset $EDITOR but with the following config I see a flash and then nothing.I assume emacs is either crashing or hanging up? Having a bit of trouble figuring out where to start debugging. Any suggestions?