vhs
vhs copied to clipboard
How can I change Shell Prompt
Is your feature request related to a problem? Please describe. I want to change the shell prompt.
Describe the solution you'd like I'd like to have the chance to change the start symbol of the shell prompt, for example:
λ Commands with lambda at start
λ pwd
Σ Commands with sigma at start
Σ pwd
Describe alternatives you've considered Add a config variable like:
Set Prompt λ or Set Shell Prompt λ
Additional context Example:
Any pointers here ? My bash
prompt always start with bash-5.0$
and I can't change it...
Tried:
- setting
Set Shell "bash --norc --noprofile"
to no effect - exporting PS1 in hide mode:
Hide
Type "export PS1='$ '" Sleep 50ms Enter
Sleep 1s
Show
but this still shows the line bash-5.0$ export PS1='$ '"
on top of the gif.
+1, interested on this feature
Hey there! Thank you for the issue, I believe we should probably add some sort of setting for the PROMPT
or allow setting environments (or both!):
Proposed solution:
Set Prompt "> "
Or:
Env PROMPT "> "
I'm leaning towards the Env
solution as it provides other environment to be set, and it is a more flexible solution.
Both sound like a good solution. Still wondering how to this day all the examples gif are starting with a blue arrow ...
Currently the prompt is hardcoded in, so it should be using that prompt: https://github.com/charmbracelet/vhs/blob/ed89b8b81081828548896e30dbe3770921f5e92c/shell.go#L23
and the default shell is bash
.
What version of VHS and ttyd
are you using and which operating system?
Weird, for me the default shell is bash-5.0$
...
Running latest version of VHS with Ubuntu 20.04.6 LTS running in a Vagrant VM:
vagrant@ubuntu2004:~/secator$ vhs -v
vhs version v0.7.1 (537d03a)
vagrant@ubuntu2004:~/secator$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
vagrant@ubuntu2004:~/secator$ ttyd -v
ttyd version 1.7.4-68521f5
I see, @ocervell do you have anything in your ~/.login
/ ~/.bash_login
out of curiosity?
We use a --login
shell and I'm wondering if perhaps the prompt is being overridden there. If that's the conflict then we can perhaps override with VHS by setting the prompt after that.
Nope, the files don't even exist on my machine.
We have this in the ~/.bashrc:
if [ "$ASCIINEMA_REC" == "1" ]; then
PS1='\$ '
elif [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
I'm facing the same issue as @ocervell.
vhs version v0.7.1
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic
ttyd version 1.7.4-68521f5
I saw the bash-5.2$
prompt on https://github.com/edoardottt/images/blob/main/pphack/pphack.gif ...
@maaslalani any other ideas to help working it out ?
Any update ? I've switched to asciinema
at the moment just because of this issue but I really like vhs
otherwise ...
Hey @ocervell, no update so far, I haven't looked into this issue yet. This is definitely something we'll have to solve though as changing the prompt is quite important!
Set Shell
to fish
, it somehow magically works. The prompt looks like the one in README.md
of this repository.
thanks for the suggestion @kovmir , however it doesn't solve the problem for me
thanks for the suggestion @kovmir , however it doesn't solve the problem for me
Would this help you?
@kovmir changing the shell to fish
worked for me on my VMWare Debian VM, but not on my Vagrant Debian VM. Weird.
Hi, I can work on this issue because I also need this.
Awesome @Delta456, thank you for the support. I've assigned you to the issue!