about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline/e.nix
Commit message (Collapse)AuthorAgeFilesLines
* treewide: s6-test is dead, long live eltest! s6-test-removedsternenseemann2023-04-101-1/+1
| | | | | | | | | | | | Recent versions of s6-portable-utils no longer include s6-test which was deprecated in favor of eltest which supposedly has the same interface. I've not tested this commit very thoroughly, but my system now builds again with recent nixpkgs commits (I think I dependended on s6-test via the rust writer via nman). cc @Profpatsch
* pkgs/profpatsch/e: fix by rewriting in rust and execing into blockProfpatsch2021-07-271-14/+4
| | | | | | | | | | | calling `execlineb -c` has unfortunate quoting issues, cause for cornercases like arguments that contain spaces or `"` the result would be a completely broken command line. Instead, let’s do our own block construction in a small rust program (for speed). I tried implementing it in bash first but even prepending spaces to a string is a complete waste of time in that language.
* pkgs/profpatsch/e: translate [ and ] to block boundariesProfpatsch2020-12-281-9/+20
| | | | | | | | | | | | | Since the goal of using `e` with argv is interactive execution of block-style commands from the command line, the use of { and } for blocks is sub-optimal, since bash (and ostensibly also fish) interpret them as metacharacters and assign some semantics. [ and ] on the other hand are not taken (apart from the `[` executable, which is only relevant in command position and can always be replaced by the `test` command). So we translate a stand-alone "[" argument to "{" and the same for "]"/"}", giving us a transparent block syntax.
* pkgs/profpatsch/e: allow passing a block-style argument as argvProfpatsch2020-12-281-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Often times I want to execute “block-style” programs directly, but it is rather inconvenient to type out `execlineb -c "…"` every time, plus -c wants the argv as a single string instead of an argv. The alternative, using the block representation with leading spaces, is even less ergonomic. So instead of execlineb -c "nix-run { -A pkgs.profpatsch.e ~/vuizvui } echo hello" or even nix-run ' -A' ' pkgs.profpatsch.e' ' /home/me/vuizvui' '' echo hello I can now write e nix-run { -A pkgs.profpatsch.e ~/vuizvui } echo hello and it will work as expected (provided your shell expands inside {} blocks, which bash does but fish doesn’t for some reason). If no argument is passed, e falls back to opening a shell prompt.
* pkgs/profpatsch/execline/e: better promptProfpatsch2020-01-261-12/+14
| | | | | | rlwrap has to do magic recognition, which breaks in most cases. We can just print a prompt before the first and after each consecutive command. Seems to work wonderfully.
* pkgs/profpatsch/execline/e: add prompt colorProfpatsch2020-01-261-0/+2
|
* pkgs/profpatsch/execline/e: fix buffering problemProfpatsch2020-01-261-3/+0
| | | | Forgot the cat after I added forstdin.
* pkgs/profpatsch/execline/e: fix line splittingProfpatsch2020-01-261-6/+6
|
* pkgs/profpatsch/execline: add eProfpatsch2020-01-261-0/+23