|
|
|
|
|
by hnlmorg
3196 days ago
|
|
Maybe you could support a user-defined auto-completion config like Bash et al do for theirs and IDEs would for custom languages too. With regards to the shell input: I don't know how you are currently detecting the $SHELL prompt (and thus when you can do your auto-completion) but maybe you could allow users to specify hooks for what to watch for to determine the different between the $SHELL and other tools, based on the $SHELL prompt (possibly using $PS1 env var?) For example you could define that $SHELL's prompt would be: SHELLPROMPT>
And when you read that from the $SHELL's STDOUT you know the shell is waiting for prompt. There is obviously the danger that your term would get confused if SHELLPROMPT> happens to appear in the STDOUT when not part of the prompt that it would confuse your term, so perhaps you might need to include an ANSI escape sequence in there as well. Or maybe even define your own custom ANSI escape sequence that $SHELL's need to include in their prompt? (I'm mostly just brainstorming at the moment so these ideas might be worse than your current implementation).As a side note, the project I'm currently working on is a $SHELL that supports defining data types to STDOUT and STDERR. The issue I have is that those byte streams are typeless and scripts written in my $SHELL needs to work with existing POSIX utilities and potentially on other $SHELLs with untypes streams. Plus I wanted people to be able to type those streams from other languages as well if they wanted and for my $SHELL to understand that. The solution I've decided upon was for an ASNI escape sequence to surround a string with the typed information and for this to only be a included if an environmental variable was set to the name of my shell. This is how I'm working around limitations with POSIX compatibility while still offering a richer environment to develop in when my $SHELL is running (I hope that makes sense). In fact it sounds like we are attempting to solve similar problems but from a different angle - with myself targeting the $SHELL while you are targeting terminal emulation (which it probably why I'm warming to your project). |
|