[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setup screen session as an IDE on shell

From: Stdcerr
Subject: setup screen session as an IDE on shell
Date: Fri, 27 Dec 2019 04:29:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1

I would like to write a script that uses screen to automatically create a few windows within which particular commands will be executed. Think of it like an IDE on the shell. Now I know that I can create windows and applications launched within them. Now, I would like to launch the following commands in window's given descriptive names:

    chdir ~/src/projectA
    * vim
    * git pull
    * cd build/
    * cd build/ && tmux

The intention is to launch the session from a script with:

    /usr/bin/screen -dmS name -c /home/user/scripts/.screenrc_name

Where `~/scripts/.screenrc_name` looks like:

    #bind keys to move between regions
    bind j focus down
    bind k focus up
    bind l focus right
    bind h focus left
    # don't display the copyright page
    startup_message off

    # increase scrollback buffer size
    defscrollback 10000

    # don't kill window after the process die
    zombie "^["

    # create windows
    chdir ~/src/scaper
    screen -t code vim &
    screen -t git git pull &
    screen -t build cd build/ &
    screen -t exec cd build/ tmux

When I connect to the session with `screen -r name`, I get into the `exec` window correctly, but it's stuck and it says `Cannot exec `cd`: No such file or directory`. And I'm getting the following:

    $ which cd
    which: no cd in (/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)
    [ron@OldNotebook scripts]$ type cd
    cd is a shell builtin

I was wondering how I best address this issue?

Thank you!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]