nushell / demo

Experimental wasm-based Nu playground
https://www.nushell.sh/demo/
MIT License
23 stars 11 forks source link

List of commands that don't work here #18

Open jzaefferer opened 4 years ago

jzaefferer commented 4 years ago

alias: alias say-hi [] { echo 'Hello!' }; say-hi => error: Failed to spawn process

autoenv: might be possible to emulate with #3 or #34, but seems like overkill

cal, date: panicked at 'not implemented', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/time-0.1.43/src/sys.rs:101:9

cd, cp, du, enter, exit, mkdir, mv, pwd, rm, save, touch: depends on #34

clear is meaningless in the browser

config: not supported in wasm; not sure how useful this really is though

debug: not sure how this works, since all the examples are using FS. Simply running debug outputs nothing.

describe: similar to debug, it partially outputs ansi color codes, e.g. for echo '[{"name":"Bob","age":25},{"name":"Fred","age":35}]' | from json | describe it outputs this:

Screenshot 2020-07-18 at 11 27 26

empty?: not sure how to use this, since neither inline docs nor the website have examples (no docs for the command there at all)

fetch: 'failed to spawn'. We could make a custom implementation using the browser's fetch API.

history: error: Could not open history - maybe we can create that file with the vfs and update it with each command that the user runs?

kill: not supported in wasm; could emulate processes as web workers, list them with ps and kill them.

lines: the example shells out to native echo (^echo "two\nlines" | lines), which doesn't work here. I'm not sure how else to use lines

n/p: next, previous shell, doesn't do anything, not even output an error, though that also applies for the CLI. Help text doesn't explain how to use these.

random bool: needs a custom implementation like random dice

run_external: this looks like it makes no sense in this context, and should show a proper error message. Currently run_external echo gives back Failed to spawn process.

shells: This actually works, but without other shell-related commands, its difficult to test properly.

shuffle: fails badly (#12), probably same issue as with random bool.

split-by: no example, no markdown docs, and based on the description I have no idea how to use this

table: I'm not sure what this actually does, since, for example, sys and sys | table seem to do the same thing. Though here it breaks badly (#12)

with-env: error: operation not supported on wasm yet

sophiajt commented 4 years ago

I wonder if we can fix the alias one to work. Looks like the alias isn't set at the end of ; but we could think about making that possible:

20/07/2020 06:10:24> alias say-hi [] { echo 'Hello!' }; say-hi
error: Command not found
  ┌─ shell:1:36
  │
1 │ alias say-hi [] { echo 'Hello!' }; say-hi
  │                                    ^^^^^^ command not found
jzaefferer commented 4 years ago

@fdncred @jonathandturner I've finished the list! Overall looking pretty good.

I would appreciate some help with #12.

PS: I deleted the now-irrelevant comments about ansi and `char.