Skip to content

Commit 12a357a

Browse files
committed
redefines home as the directory fromwhere it is called
1 parent 83766cc commit 12a357a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

instructors/terminal.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ tmux send-keys -t "${SHELL_PANE}" " unalias -a" enter
7878
tmux send-keys -t "${SHELL_PANE}" " export PS1=\"\[\033${CYAN}\]\! $\[\033[0m\] \"" enter
7979

8080
#A prompt showing `user@host:~/directory$ ` can be achieved with:
81-
tmux send-keys -t "${SHELL_PANE}" " export PS1=\"\\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\u\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ \"" enter
81+
# tmux send-keys -t "${SHELL_PANE}" " export PS1=\"\\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\u\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ \"" enter
82+
83+
# Modified PS1 that uses SCRIPT_HOME as the base directory
84+
SCRIPT_HOME="$(pwd)"
85+
tmux send-keys -t "${SHELL_PANE}" " export SCRIPT_HOME='${SCRIPT_HOME}'" enter
86+
tmux send-keys -t "${SHELL_PANE}" " export PS1=\"\\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\u\\[\\033[00m\\]:\\[\\033[01;34m\\]\\\${PWD/#\\\$SCRIPT_HOME/\~}\\[\\033[00m\\]\\$ \"" enter
87+
tmux send-keys -t "${SHELL_PANE}" " cd $SCRIPT_HOME" enter
88+
8289

8390
#Set terminal colours
8491
if [ ! -z "$BGCOLOR" ]; then

0 commit comments

Comments
 (0)