4 ms·
Gorgeous. Amazing. Absolutely fantastic. Easy the coolest and most useful thing I've seen on hacker news in a while. Enough gushing, now some bug reports: "re
by jfasi 13y ago
Gorgeous. Amazing. Absolutely fantastic. Easy the coolest and most useful thing I've seen on hacker news in a while.
Enough gushing, now some bug reports:
"read -r random_line < <(sort -R file)"
yields
"syntax: expecting filename or fd (position 22)"
"nc HOST PORT | tee movie.mp4 | mplayer -"
I can hover over movie.mp4, but I can't scroll down the see the description without losing the emphasis on that path. I'd suggest letting the user click on the portion, or perhaps a long-hover effect?
- icebraining 13y agoThe first bug is acknowledged in the page: "support for (...) command substitutions will be added later on"
- rcthompson 13y ago> I can hover over movie.mp4, but I can't scroll down the see the description without losing the emphasis on that path. I'd suggest letting the user click on the portion, or perhaps a long-hover effect? What if the command was simply pinned to the top of the screen as you scroll down? This would require some trickiness to make the atoms remain connected to their documentation as the documentation slides under the command, but would allow you to view any documentation on the same screen as the command itself. EDIT: On the other hand, I just noticed that there are buttons to only show the documentation for specific subcommands, so you can always use those to cycle until the documentation you want to see is visible.
- angersock 13y agoThe wiring is sexy, but this is a textbook cases where tabbed panes would be perfect: just have each command segment be a tab, and the corresponding docs be in a pane underneath.
- logicallee 13y ago(I have no relationship with OP or the submitter/submission). >Gorgeous. Amazing. Absolutely fantastic. Easy the coolest and most useful thing I've seen on hacker news in a while. >Enough gushing, now some bug reports: I like the way you wrote your comment! It could stand as an example to everyone. Yours might have had enough gushing, but I think every "negative" comment should start with as high praise as it can muster. If the whole thing isn't as good, then it should first be "damned with faint praise" and then specific constructive criticisms shown. Obviously the praise doesn't have to be as strong as your comment. I just want to point out how awesome a comment like yours is - it is incredibly hard to put together and share something. We could all do well to remember that when we point out how to improve it.
- idank 13y agoThanks, that's really fun to hear. ACK on the command substitution not working, with the current lexer that I have in place fixing this isn't easy and might take a while. But it's definitely up there on my todos. Yeah, long pipelines are somewhat of a problem. You can currently navigate the commands with the buttons at the top, maybe they're not visible enough. But I like the idea of being able to pin a particular line by pressing it, but I fear it might be a bit subtle and easy to miss.
- jfasi 13y agoI liked one idea submitted: having the command pin to the top of the screen on scroll down. It would be tricky to make happen with the hover effect for the boxes, though.
- idank 13y agoYes, I had this suggested on numerous occasions and gave it a go a while ago and it's indeed not trivial. If a JS wiz would like to hack on this I'll gladly help and accept it.
- drothlis 13y agoDo you have any thoughts, or writings that you could point me to, regarding shell's parseability? For example, is it possible to parse a shell script without running it? Would it be possible to extract Bash's lexer+parser into a stand-alone library to be used by IDEs?
- idank 13y agoYes, you can parse without executing. I think shell is easier to parse than it seems, there are definitely some nuances that might be tricky to emulate, but I guess it's a matter of effort and how far you're willing to go. For syntax highlighting in IDEs, you probably don't need much, and maybe even a few regexs can get you close enough. I actually spent a considerable amount of time going over bash's parser [0], and also zsh's [1]. Bash uses lex/yacc with some custom code. zsh seems to have a custom written lexer/parser. Unfortunately none of them were written to be used as a library, as evident by global state, and a lot of hooks for prompts while parsing, etc. It might be possible to somehow make it work, but it seems like a lot of work to me. You might have an easier time looking at the parser I wrote, and extending that, or rewriting it in another language (as it's fairly small compared to the ones you find in shells). There's also libbash [2], haven't looked closely though. [0]: http://git.savannah.gnu.org/cgit/bash.git/tree/parse.y http://git.savannah.gnu.org/cgit/bash.git/tree/parse.y [1]: https://github.com/zsh-users/zsh/blob/master/Src/parse.c https://github.com/zsh-users/zsh/blob/master/Src/parse.c [2]: http://www.gentoo.org/proj/en/libbash/ http://www.gentoo.org/proj/en/libbash/