celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Offermans <marcel.offerm...@luminis.nl>
Subject Re: shell refactoring
Date Tue, 03 Nov 2015 11:23:34 GMT
The only reason I’m asking is because that’s how the gogo shell works in Felix. It has
a context per shell. I was curious if you also wanted to go for that design, as sharing a
context between multiple shells might give some awkward results (if you allow commands to
operate on such context… cd / in one shell, then rm -rf * in the other :D).

On 3 November 2015 at 12:21:02, Pepijn Noltes (pepijnnoltes@gmail.com) wrote:

Hi Marcel,  

On Tue, Nov 3, 2015 at 11:49 AM Marcel Offermans <  
marcel.offermans@luminis.nl> wrote:  

> Hello Pepijn,  
> If you’re going to support multiple shells concurrently, does that also  
> mean that each shell has its own “context” to keep state (ie to keep track  
> of things like current directory, environment variables, …)?  

Currently not, so we only support multiple front-ends to a shared shell.  
This was already the situation before the ractoring, but in that case a  
global var was needed to keep track of the "current" file descriptor.  
Moving to a stream abstraction (FILE in c) removed this workaround.  

It there any specific reason you ask this ? To be honest, I never (yet) had  
the need for multiple shell contexts ...  


> Greetings, Marcel  
> On 3 November 2015 at 10:21:02, Pepijn Noltes (pepijnnoltes@gmail.com)  
> wrote:  
> Hi All,  
> I just pushed the shell refactoring branch to develop. Within this feature  
> the command service has been updated. WIth this update you must implement a  
> execute function working with a FILE streams (FILE *), for "normal" and  
> error output, instead of two write functions. This was done so that it is  
> easier to support multiple connections (e.g. the remote shell).  
> This update includes the needed updates for shell, shell_tui and  
> remote_shell. Current shell_bonjour is not yet supported.  
> Note that this is a backwards incompatible change, so if you created your  
> own shell commands these needs to be updated.  
> I also took the liberty to change the 'ps' command to 'lb', more conform  
> the 'lb' command from the Apache Felix Gogo shell.  
> Greetings,  
> Pepijn  

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message