Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] Local Terminal Interpreter with "cd" and "npm"

Hi everybody,

I have seen you are continuing to improve the open of nodejs process (like npm install) with an Eclipse Console, but IMHO I think it should be better to use Terminal:

 * you benefit with syntax coloration when there are ANSI characters which is displayed in the console.
 * you benefit with progress bar when ANSI characters display progress bar (like ng new $project-name from @angular/cli)
 * you can interact with the Terminal when command display some prompt.

In my case I have forked your Cli classes to support @angular/cli but for those 3 reasons I have investigate more Terminal work.

Here a demo with "ng generate class MyClass":




The wizard:

 * opens a Terminal command (cmd.exe)
 * copy/paste the command to execute (here: "ng generate class MyClass")
 * submit the command
 * when command is terminated, it opens the @angular/cli generated class file: it interprets commands and open in an editor the generated class.

To do that, I had to extend TerminalService to:

 * give the capability to execute a command coming from outside (in my case it's the wizard which opens the terminal, copy/paste the command in the terminal and validate the command)
 * give the capability to manages command events: submitCommand, execuntingCommand, terminateCommand
 * on terminateCommand event an interpreter is executed (here it's the ng generate command which opens the generated class in an editor).

Hope you will like this feature and JSDT will be interested with this feature.

Regard's Angelo

zaza



2016-06-21 9:50 GMT+02:00 Angelo zerr <angelo.zerr@xxxxxxxxx>:


2016-06-20 10:50 GMT+02:00 Max Rydahl Andersen <manderse@xxxxxxxxxx>:

Hi Max!
Very nice idea.

Glad this idea please you:)
 
Similar to what we've had for Forge tools in JBoss Tools for a while.

You used Terminal too? It was very difficult for me to implement this interpreter feature because TM doesn't provide some callbacl like:

 * the user has typped "Enter" to validate the command.
 * the command is finished.

So I had stuidied ANSI/VT100 Terminal Control http://www.termsys.demon.co.uk/vtansi.htm and it works for my OS Windows, but I don't know if it works with other OS.
For instance, I have emulated Enter when I found Query Cursor Position <ESC>[6n (Requests a Report Cursor Position response from the device).

It works well with Windows, but I don't know if other Shell OS works like this?

Your idea about hooking it into the native terminal itself is great and makes it
more readily available

Thanks!
 
- did you
open any bugzillas/patches for the terminal to allow this kind extension without
a custom terminal ?


The "Local Terminal (Interpreter)" is an extension point of TM to defines a new Local and add my own listener to track character. But I think it should be better that "Local Terminal" hosts my code or better that http://git.eclipse.org/c/tm/org.eclipse.tm.terminal.git/tree/plugins/org.eclipse.tm.terminal.control/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java#n281 provides listener. Indeed in my case I have copied/pasted this classes and adapt it to retrieve Enter and line text (without other character like color, font, etc)

My fear is that Eclipse TM seems not very active, so I hope that guys like you will ping https://bugs.eclipse.org/bugs/show_bug.cgi?id=496109 to motivate the author.

Many thanks for your help!
/max
Hi Ilya,


2016-06-17 21:51 GMT+02:00 Ilya Buziuk <ibuziuk@xxxxxxxxxx>:
Hello, Angelo
I do believe this is very useful functionality for bower / npm. 

Very glad this idea please you!
 
Basically, bower / npm tools covers only install & update, which is pretty limited and will not replace CLI in many.  cases. I really like the idea with providing extension point for different interpreters, so that other CLI based tools can be adapted for the terminal. 

It's exactly my idea! I'm cleaning my code to support extension point. For the moment, I will host my plugin in typescript.java.

Here 2 new demos with Angular2 

 * with "ng new" : after ng new create an angular2 project, the interpreter create an Eclipse Project and opens the generated package.json:
 



 * with "ng server": when you start ng server, the interpreter open a Web Browser when trace "Serving on http://localhost:4200/" appears:



I think, we can imagine a lot of features with this interpreter.

Regard's Angelo



_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev


_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev

_______________________________________________
wtp-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
/max

_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev



Back to the top