mskyaxl / wsl-terminal

Terminal emulator for Windows Subsystem for Linux (WSL)
MIT License
3.12k stars 158 forks source link

.bash_profile not loading automatically when i open wsl-terminal #121

Closed LJHayman closed 4 years ago

LJHayman commented 6 years ago

is there a way to get this file to load as soon as i open the wsl-terminal?

currently i have to source it every time

thanks!

edit-

and when i try to add a source command to open-wsl like: (e.g. -c "echo a b; echo c; cat") the process dies and the screen closes as soon as it's executed

hawm commented 5 years ago

In my solution is run wsl-terminal with -l option by creates a shortcut. And you can also modify the 'etc/wsl-terminal.conf' (relative path of the wsl-terminal binary but not '/etc/wsl-terminal.conf'), comment the other line using semicolon and tail with --login option which bash you wish.

;shell=/bin/bash
shell=/bin/bash --login
;shell=/bin/zsh

it make you use wsl-terminal as a login shell

25

TylerZhang1993 commented 5 years ago

1.Modify shell=/bin/bash in etc/wsl-terminal.conf file to shell=/bin/bash--login

  1. or you can modify .bashrc file to add the relative command
mskyaxl commented 4 years ago

or use 4-create-start-menu-shortcut-login-shell.js to create a shortcut for you :)