plasma-umass / browsix

Browsix is a Unix-like operating system for the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Several shell issues/feature requests

nloveladyallen opened this issue · comments

$ multiline commands\
/usr/bin/multiline: command not found
$ FOO="bar"
/usr/bin/FOO="bar": command not found
$ ls $(ls usr)
ls: /$(ls: No such file or directory.
ls: /usr): No such file or directory.
$ ls `ls usr`
ls: /`ls: No such file or directory.
ls: /usr`: No such file or directory
$ # comment
/usr/bin/#: command not found
$ echo hi > README
hi > README
$ echo hi >> README
hi >> README
$ echo foo && echo bar
foo && echo bar
$ echo foo; echo bar
foo; echo bar
$ ls *
ls: /*: No such file or directory.
$ echo !!
!!
$ usr/bin/echo foo
/usr/bin/usr/bin/echo: command not found
$ ./README
Error while executing undefined: SyntaxError: missing ; before statement

(The last one should fail, but because of permissions.)

thanks! those are all useful features. over the next week or so I'll be working on the shell which I think should address all of these. I'll leave this open until then.

Any update on this?

I plan on working on dash support this week, but it will probably take into next week to settle out. I will update here when there is progress. Thanks for keeping my feet to the fire :)

Hi @nloveladyallen, an update:

We now use dash as our shell, so the following constructs work:

cat README | while read l; do echo "README: $l"; done

However, we execute each command in its own sh instance (by invoking sh -c "$CMD"). This week I'm working on TTY support in the kernel; with that we should be able to finally have a single long-running shell where you can set environmental variables and change the cwd and I'll be able to close out this issue.

Well, it doesn't seem to quite work yet 😛

$ cat index.json | while read l; do echo "index.json: $l"; done
index.json: {"bin":{"sh":null},"boot":{"kernel.js":null},"usr":{"bin":{"cat":null,"cpu-intensive-program":null,"cp":null,"curl":null,"echo":null,"exec":null,"grep":null,"head":null,"hello":null,"hello-socket":null,"http-example":null,"ld":null,"ls":null,"mkdir":null,"nice":null,"node":null,"pipeline-example":null,"priority-test":null,"rm":null,"rmdir":null,"sh":null,"sha1sum":null,"socket-example":null,"sort":null,"stat":null,"tail":null,"tee":null,"touch":null,"wc":null,"xargs":null}},"index.json":null}
Error while executing undefined: uncaught exception: abort() at jsStackTrace@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:1:18621
stackTrace@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:1:18792
abort@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:12:5003
_abort@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:1:672111
Gb@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:31878
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:10067
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:7348
Jb@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:36470
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:11353
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:7348
hc@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:39515
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:11353
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:7348
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:7348
Vb@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:37874
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:11353
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:7348
Dc@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:42677
Cd@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:48693
invoke_iii@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:1:686600
Db@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:5:9288
resume@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:1:653133
resume/<@blob:http://localhost:5000/a44d42e0-1b5c-aa45-964b-5c1766b1097e:1:652786

If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
Unknown signal (core dumped)

what if instead of using dash you made a shell with typescript syntax that supported cating html files and of course have a text mode option to display it as plain text