Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminator initial script

I'm current user of terminator & oh-my-zsh. In teminator I tried to set my custom layout with several tabs and initial commands for every tab. I followed instruction as described here https://amir.rachum.com/blog/2015/11/28/terminator-multiple-custom-commands/ Main part there is this script in .zshrc

echo $INIT_CMD
if [ ! -z "$INIT_CMD" ]; then
    OLD_IFS=$IFS
    setopt shwordsplit
    IFS=';'
    for cmd in $INIT_CMD; do
        print -s "$cmd"  # add to history
        eval $cmd
    done
    unset INIT_CMD
    IFS=$OLD_IFS
fi

Everything works fine except commands from initial script are not stored in my zsh history. If I execute commands directly in zsh it works properly as well. My guess is that history file loaded after my command is executed.

like image 662
Gleb Avatar asked Jul 02 '26 02:07

Gleb


1 Answers

Simple solution for bash

append ;bash to you custom command

Example: change redis-server to redis-server; bash

like image 73
nemanjabu Avatar answered Jul 06 '26 19:07

nemanjabu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!