Terminal

8 views
Skip to first unread message

James Lyndsay

unread,
Oct 17, 2019, 10:33:31 AM10/17/19
to ICEcoder
Hello – is it possible to change the directory that the terminal starts in – either via config, or by adjusting the code?

The terminal starts in /var/www/html/ICEcoder/lib
I'd like to to start in /var/www/html/«whatever»

Backstory: I use ICEcoder in a workshop. I have an Ansible script to set up a DigitalOcean droplet for each participant. Each droplet has ICEcoder to be used as a file browser, as an IDE and as a terminal. ICEcoder lets me give each participant in the workshop reliable (for them) and consistent (for me) access to their own server for building and testing, without requiring anything much from their kit and configuration.

I can get my participants to change the terminal's directory with cd /var/www/html/«whatever» ... but I don't want to. I'd rather they were there at the start. I can't see anything in the config file, but maybe I'm looking in the wrong place. (so far, config-«serverinfo».php and config-settings.php).

One reason I'd like to avoid using cd anything is that cd ../ or cd ../../ from the initial directory, the first time, makes the browser hang...

Cheers –

James



Matt Pass

unread,
Oct 18, 2019, 4:53:49 PM10/18/19
to ICEcoder
Hi James

It definitely seems like a few issues to be sorted there.

I've added an issue on GitHub, which notes the regex lines that seem to cause the hanging. Commenting those out means it mostly works, but it is confused about the directory it's in (it mismatches what is shown in the prompt).

Will look at sorting this as a priority.

When it is fixed then you should be able to set a start directory using something like this:

// We have no session set yet for cwd, so set for first time since arrival
if (!isset($_SESSION['cwd'])) {
    chdir("/your/dir/here");
    $_SESSION['cwd'] = getcwd();
}

However, this is untested code and it needs to have bugs fixed first before thinking about setting a starting dir.

Will look at this very soon and update here and on GitHub issue.

Matt
Reply all
Reply to author
Forward
0 new messages