Smashgen
Smashgen

Reputation: 151

Open terminal windows and execute custom commands in them?

I just figured out how I can open a new terminal and immediately send it commands. The command I'm using on Linux Mint is "mate-terminal -x zsh -c '(stuff here) ; exec /bin/zsh". But, I hit a wall in regards to calling functions and aliases defined in my .zshrc file. Instead it says "zsh:1: command not found: ".

Upvotes: 0

Views: 226

Answers (1)

osgx
osgx

Reputation: 94165

.zshrc file is only used for interactive shells, http://linux.die.net/man/1/zsh

Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc

There is -i option ("Force shell to be interactive.") which may help you, try:

mate-terminal -x zsh -c '(stuff here) ; exec /bin/zsh -i'

or if you have zshrc commands in stuff:

mate-terminal -x zsh -ci '(stuff here) ; exec /bin/zsh -i'

Upvotes: 2

Related Questions