Open bleggett opened 4 years ago
tell me the value of (vterm--prompt-tracking-enabled-p)
and I think you should enable
Directory tracking and Prompt tracking
https://github.com/akermu/emacs-libvterm#directory-tracking-and-prompt-tracking
https://github.com/akermu/emacs-libvterm#shell-side-configuration
or custom term-prompt-regexp
, make it match your prompt .
@jixiuf it's nil
- and I've properly set up directory and prompt tracking for zsh
as per those instructions - I'm on macOS and am using a custom ZSH prompt but I assume that even with a custom prompt the below is all I should need for this to work:
# Added for Emacs libvterm
vterm_printf(){
if [ -n "$TMUX" ]; then
# Tell tmux to pass the escape sequences through
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
elif [ "${TERM%%-*}" = "screen" ]; then
# GNU screen (screen, screen-256color, screen-256color-bce)
printf "\eP\e]%s\007\e\\" "$1"
else
printf "\e]%s\e\\" "$1"
fi
}
vterm_prompt_end() {
vterm_printf "51;A$(whoami)@$(hostname):$(pwd)";
}
setopt PROMPT_SUBST
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
Inside the vterm, this is the value of $PROMPT
/ » echo $PROMPT useer@machine
$FG[237]------------------------------------------------------------%{$reset_color%}
$FG[032]%~\
$(git_prompt_info) \
$FG[105]%(!.#.»)%{$reset_color%} %{$(vterm_prompt_end)%}
it's weird the value of (vterm--prompt-tracking-enabled-p)
is nil
.
does you eval (vterm--prompt-tracking-enabled-p)
in vterm buffer.
I have the same problem but without the ^K
part. Doing vterm-toggle-cd
has exactly the same effect as vterm-toggle
.
My workaround is this:
(defun tmalsburg-vterm-toggle-cd-show ()
(interactive)
(vterm-toggle-cd-show)
(vterm-toggle-insert-cd))
(define-key vterm-mode-map [f4] 'tmalsburg-vterm-toggle-cd-show)
I had the same issue. (vterm--prompt-tracking-enabled-p) is nil. for me as well.
My experience with vterm-toggle-cd
is the following:
vterm-toggle-insert-cd
, but it doesn't insert it automatically.vterm--prompt-tracking-enabled-p
is 2
for me
Maybe this is me not understanding how the package works, but when I invoke
vterm-toggle-cd
I expect it to bring up a vterm buffer andcd
to the location of the last active buffer.Instead, calling that function inserts![Screen Shot 2020-07-09 at 12 38 24 PM](https://user-images.githubusercontent.com/854255/87066970-64bafd80-c1e1-11ea-965e-25aea89786c2.png)
^K
into the vterm buffer, like soafter this, manually calling
vterm-toggle-insert-cd
manually works correctly, but my understanding is thatvterm-toggle-cd
should be exactly equivalent to manually invokingvterm-toggle
and thenvterm-toggle-insert-cd
- for me it's not.Am I missing something?