Local Terminal Interpreter with "cd" and "npm"

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Local Terminal Interpreter with "cd" and "npm"

Angelo zerr
Hi everybody,

I would like to know if you could interest with my work about "Local Terminal Interpreter". The basic idea is to interpret Terminal command to refresh the workspaces like project explorer. Here a demo where you can see:

 * "cd" command: when terminal executes "cd" command, the Project Explorer select the well folder.
 * "npm install" command: when terminal executes "npm install acorn", it refresh the parent folder where npm was executed and select the node_modules folder.



I think JSDT could be interested to refresh the Project Explorer after executing an "npm install" (like the demo) and for bower too.

In my case, I will use it to support Angular2 angular-cli to refresh the Project Explorer with components files which was generated with angular-cli.

For the moment, command interpreter are hard coded, but my idea is to provide an extension point to provide any interpreter.

I have posted my suggestion for Terminal project at https://bugs.eclipse.org/bugs/show_bug.cgi?id=496109 but none answer (I'm afraid that the project is not very active).

Today I define a new Local Terminal Interpreter, but I think Local Terminal could hosts this interpreter feature (that we could desactivate with a settings).

Hope you will like this feature and hope you will help me to try to ping Terminal guys to support this features.

Regard's Angelo


_______________________________________________
wtp-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Ilya Buziuk
Hello, Angelo
I do believe this is very useful functionality for bower / npm. 
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. 

On Fri, Jun 17, 2016 at 3:55 PM, Angelo zerr <[hidden email]> wrote:
Hi everybody,

I would like to know if you could interest with my work about "Local Terminal Interpreter". The basic idea is to interpret Terminal command to refresh the workspaces like project explorer. Here a demo where you can see:

 * "cd" command: when terminal executes "cd" command, the Project Explorer select the well folder.
 * "npm install" command: when terminal executes "npm install acorn", it refresh the parent folder where npm was executed and select the node_modules folder.



I think JSDT could be interested to refresh the Project Explorer after executing an "npm install" (like the demo) and for bower too.

In my case, I will use it to support Angular2 angular-cli to refresh the Project Explorer with components files which was generated with angular-cli.

For the moment, command interpreter are hard coded, but my idea is to provide an extension point to provide any interpreter.

I have posted my suggestion for Terminal project at https://bugs.eclipse.org/bugs/show_bug.cgi?id=496109 but none answer (I'm afraid that the project is not very active).

Today I define a new Local Terminal Interpreter, but I think Local Terminal could hosts this interpreter feature (that we could desactivate with a settings).

Hope you will like this feature and hope you will help me to try to ping Terminal guys to support this features.

Regard's Angelo


_______________________________________________
wtp-dev mailing list
[hidden email]
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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Angelo zerr
Hi Ilya,


2016-06-17 21:51 GMT+02:00 Ilya Buziuk <[hidden email]>:
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
[hidden email]
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
[hidden email]
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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev

ngserver.gif (623K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Mickael Istria-5
In reply to this post by Angelo zerr
On 06/17/2016 03:55 PM, Angelo zerr wrote:
 * "cd" command: when terminal executes "cd" command, the Project Explorer select the well folder.
I do not think that all people will enjoy seeing this selection changed without them being aware of it. So if you're going to contributor, it most likely requires a way to switch it on/off from Terminal.
Note that rather than listening to the "cd" command, just listening to the current path of the terminal on each command may be more generic (supports pushd or other commands changing directories but not being cd)
 * "npm install" command: when terminal executes "npm install acorn", it refresh the parent folder where npm was executed and select the node_modules folder.
Refreshing when we know something changed is a good thing.
I have same concerns as above about immediately changing selection.
I have posted my suggestion for Terminal project at https://bugs.eclipse.org/bugs/show_bug.cgi?id=496109 but none answer (I'm afraid that the project is not very active).
I'll post my comments there.

--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets

_______________________________________________
wtp-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Angelo zerr
Hi Mickael,

2016-06-20 10:18 GMT+02:00 Mickael Istria <[hidden email]>:
On 06/17/2016 03:55 PM, Angelo zerr wrote:
 * "cd" command: when terminal executes "cd" command, the Project Explorer select the well folder.
I do not think that all people will enjoy seeing this selection changed without them being aware of it.

Yes sure Mickael, it was just a sample. And my idea is to provide an UI Preferences which list of contributed interpreters to disable it if you wish (by default, cd interpreter could be disable). My other idea too si to add a checkbox "with interpreter" to the existing "Local Terminal" to disable/enable interpreter.

 
So if you're going to contributor, it most likely requires a way to switch it on/off from Terminal.

No, I will not have time to become a contributor. My idea is to implement in typescript.java the "Local Terminal (Interpreter)" because I'm using for Angular2 ng angular-cli. If my work pleases to tm project, I will try to create a PR for that. If you want to try it, you can find my work at 


I have just tested with Windows OS, I don't know if it works with other OS.
 
Note that rather than listening to the "cd" command, just listening to the current path of the terminal on each command may be more generic (supports pushd or other commands changing directories but not being cd)

Yes you are right, I will try to implement your idea. 

 * "npm install" command: when terminal executes "npm install acorn", it refresh the parent folder where npm was executed and select the node_modules folder.
Refreshing when we know something changed is a good thing.
I have same concerns as above about immediately changing selection.
I have posted my suggestion for Terminal project at https://bugs.eclipse.org/bugs/show_bug.cgi?id=496109 but none answer (I'm afraid that the project is not very active).
I'll post my comments there.

Thanks! 


--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets

_______________________________________________
wtp-dev mailing list
[hidden email]
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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Max Rydahl Andersen-3
In reply to this post by Angelo zerr
Very nice idea. Similar to what we've had for Forge tools in JBoss Tools for a while.
Your idea about hooking it into the native terminal itself is great and makes it
more readily available - did you
open any bugzillas/patches for the terminal to allow this kind extension without
a custom terminal ?
/max
Hi Ilya,


2016-06-17 21:51 GMT+02:00 Ilya Buziuk <[hidden email]>:
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
[hidden email]
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
[hidden email]
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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Angelo zerr


2016-06-20 10:50 GMT+02:00 Max Rydahl Andersen <[hidden email]>:

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 <[hidden email]>:
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Local Terminal Interpreter with "cd" and "npm"

Angelo zerr
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 <[hidden email]>:


2016-06-20 10:50 GMT+02:00 Max Rydahl Andersen <[hidden email]>:

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 <[hidden email]>:
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
Loading...