-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some cherries you might like to pick #3
Conversation
So bshell starts up on top of the screen with no clutter. It would appear that org.jline.utils.Display.clear() may also attempt to accomplish this but I haven't seen it do so yet.
I discovered a little gem in bsh.util.NameCompletionTable it's the guy that does the JConsole completion. Gets bootstrapped with the interpreter namespace and can also work the classpath. Do try with JDK8 with rt.jar loaded for pretty neat insights, Java 9 currently can't get that detail. The whole MappingFeedback listener is a tad odd, without it the ClassPath echo's to stderr what it's doing. The rest is an attempt to dive deeper obtaining members for completion, it uses bsh.Name (nameResolver)'s magic which can be a bit like a magicians top hat, you never know what you're going to get. Good proof of concept me thinks.
merging nick's changes. some comments will follow by email |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see the spice on my terminal, what was the intended behaviour?
i am not sure I have done it right .... reopening (it is my first pull request :/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what -s is for? it does not work on ubuntu linux; I removed it for now, which along should work (I guess...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool. I will look into the space problem. The result with jline is cool. I need also to work on some specs for it (similar to unit test...).
one important note: this code does not work with bsh-2.0b6, it needs the development snapshot. When do you plane to cut a release of beanshell 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually not desirable: it fails when you want to write multi-line code (e.g. print(
"hello"
);
Hi Nick,
good stuff in general. I commented the diffs. In summary:
1. on the prompt, I am ok with the change but I could not see the effects
in my console. what was the intended behaviour?
2. on completion, I am still working on it, but I would merge the code you
provided
Ste
…On Fri, Jun 8, 2018 at 7:48 PM, Nick Lombard ***@***.***> wrote:
Not necessary to merge, submitted to make it easier to share my
discoveries. Cherry pick what you'd like to keep.
Much much better experience this time around =) the shell scripts are a
welcome addition.
I worked out what CommandLineReader does to get the prompt to come back,
it sends ; to the interpreter on blank lines... magic!
Also found the guy that handles the completion for the JConsole frontend,
it also exposes the classpath and much simpler to implement.
Took a stab at diving deeper for member completion... this may need
another visit to the drawing board but as proof of concept it has value.
What you think?
Good stuff!!
------------------------------
You can view, comment on, or merge this pull request online at:
#3
Commit Summary
- Add clear window to launch script
- Nostalgia for the "bsh % " prompt with some added spice.
- Completion hacks W.I.P.
- All it needed was send `;` on blank lines... magic
File Changes
- *M* src/main/bshell/bin/bshell
<https://github.com/stefanofornari/BshConsole/pull/3/files#diff-0> (2)
- *M* src/main/bshell/scripts/init.bsh
<https://github.com/stefanofornari/BshConsole/pull/3/files#diff-1> (2)
- *M* src/main/java/ste/beanshell/ui/BshCompleter.java
<https://github.com/stefanofornari/BshConsole/pull/3/files#diff-2>
(86)
- *M* src/main/java/ste/beanshell/ui/BshConsoleCLI.java
<https://github.com/stefanofornari/BshConsole/pull/3/files#diff-3> (3)
Patch Links:
- https://github.com/stefanofornari/BshConsole/pull/3.patch
- https://github.com/stefanofornari/BshConsole/pull/3.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACogp9NKxo0jCPB0c6dYs5mpUuWfokbks5t6rjVgaJpZM4UgtQ8>
.
|
thanks nick for the explanation. I want to fix the additional space issue first, then I will look into the above. this will buy us also some time for the release. I am trying the new stuff, and I look forward to switch completely, but being not available on maven central, I would like the standard distribution to work with released packages. I've got the coloring, thanks. But I need help for the prompt. I am opening a thread on the beanshell list. BTW, my vote is for bsh8 (or 9 or 10 :) ). |
I am not mistaking, I should have incorporated all the agreed suggestions. I am closing this one, feel free to reopen if I missed anything. |
Not necessary to merge, submitted to make it easier to share my discoveries. Cherry pick what you'd like to keep.
Much much better experience this time around =) the shell scripts are a welcome addition.
I worked out what CommandLineReader does to get the prompt to come back, it sends
;
to the interpreter on blank lines... magic!Also found the guy that handles the completion for the JConsole frontend, it also exposes the classpath and much simpler to implement.
Took a stab at diving deeper for member completion... this may need another visit to the drawing board but as proof of concept it has value. What you think?
Good stuff!!