Re: Text editing in the Karaf console

2013-01-15 Thread Andreas Pieber
Definitely a BIG +1. I've done some quick editing with your patch,
karaf and the editor and I must admit I REALLY like it. Although not
perfect it would have been so incredible useful to have such a tool in
the runtime environment from time to time I'm strongly +1 to simply
include it as it and enhance/improve it as required.

Kind regards,
Andreas

On Mon, Jan 14, 2013 at 1:59 PM, Ioannis Canellos  wrote:
> I've update issue:  https://issues.apache.org/jira/browse/KARAF-2044
>
> with 2 patches, one for trunk and one for 2.3.x.
>
> If there are no objections I'd like to commit those and maybe also for
> 2.2.x.
>
> --
> *Ioannis Canellos*
> *
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Twitter: iocanel
> *


Re: Text editing in the Karaf console

2013-01-14 Thread Ioannis Canellos
I've update issue:  https://issues.apache.org/jira/browse/KARAF-2044

with 2 patches, one for trunk and one for 2.3.x.

If there are no objections I'd like to commit those and maybe also for
2.2.x.

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*


Re: Text editing in the Karaf console

2013-01-13 Thread Jean-Baptiste Onofré

Great, thanks for the update Ioannis.

I gonna take a look.

Regards
JB

On 01/13/2013 03:49 PM, Ioannis Canellos wrote:

I moved the project to https://github.com/jledit/jledit and cut a first
release. So we can finally add a command for editing.




--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Text editing in the Karaf console

2013-01-13 Thread Ioannis Canellos
I moved the project to https://github.com/jledit/jledit and cut a first
release. So we can finally add a command for editing.


-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*


Re: Text editing in the Karaf console

2013-01-08 Thread Ioannis Canellos
For now I have pushed it at: https://github.com/iocanel/vial

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*


Re: Text editing in the Karaf console

2013-01-06 Thread Guillaume Nodet
I also think a github project could be a good place.
If the project is really tied to jline, a subproject of
https://github.com/jline could be a good idea, or an individual project
maybe.
Anyway, I'm eager to have a look at the code and try it :-)


On Thu, Jan 3, 2013 at 1:55 PM, Ioannis Canellos  wrote:

> I am not sure if having it as part of the Karaf trunk would be a really
> good idea.
> Such editor can have a wider scope than the container itself and at its
> early days it could use a faster release cycle and/or contributions from
> other communities with similar needs that are not using karaf.
>
> Of course, there is always the maintenance burden of an extra subproject
> which we should take into consideration.
>
> Thoughts?
>
> --
> *Ioannis Canellos*
> *
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Twitter: iocanel
> *
>



-- 

Guillaume Nodet

Blog: http://gnodet.blogspot.com/

FuseSource, Integration everywhere
http://fusesource.com


Re: Text editing in the Karaf console

2013-01-03 Thread Jean-Baptiste Onofré

It makes sense.

Why not a jline or jansi "extension" ?

Regards
JB

On 01/03/2013 01:55 PM, Ioannis Canellos wrote:

I am not sure if having it as part of the Karaf trunk would be a really
good idea.
Such editor can have a wider scope than the container itself and at its
early days it could use a faster release cycle and/or contributions from
other communities with similar needs that are not using karaf.

Of course, there is always the maintenance burden of an extra subproject
which we should take into consideration.

Thoughts?



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Text editing in the Karaf console

2013-01-03 Thread Andreas Pieber
well, in that case I think a github project might be the best solution.
Independently we can still include it in trunk as a reference then (which
would still have my +1)..

Kind regards,
Andreas


On Thu, Jan 3, 2013 at 1:55 PM, Ioannis Canellos  wrote:

> I am not sure if having it as part of the Karaf trunk would be a really
> good idea.
> Such editor can have a wider scope than the container itself and at its
> early days it could use a faster release cycle and/or contributions from
> other communities with similar needs that are not using karaf.
>
> Of course, there is always the maintenance burden of an extra subproject
> which we should take into consideration.
>
> Thoughts?
>
> --
> *Ioannis Canellos*
> *
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Twitter: iocanel
> *
>


Re: Text editing in the Karaf console

2013-01-03 Thread Ioannis Canellos
I am not sure if having it as part of the Karaf trunk would be a really
good idea.
Such editor can have a wider scope than the container itself and at its
early days it could use a faster release cycle and/or contributions from
other communities with similar needs that are not using karaf.

Of course, there is always the maintenance burden of an extra subproject
which we should take into consideration.

Thoughts?

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*


Re: Text editing in the Karaf console

2012-12-28 Thread Achim Nierbeck
Me too, so +1 from my side also.

regards, Achim


2012/12/28 Andreas Pieber 

> TBH I would neither have a problem putting this directly on trunk. +1 from
> my side.
>
> Kind regards,
> Andreas
>
>
> On Fri, Dec 28, 2012 at 4:24 PM, Jean-Baptiste Onofré  >wrote:
>
> > Hi Ioannis,
> >
> > it could be awesome to have a kind of vi in Karaf shell ;)
> >
> > It could be very interesting to mix your text editor with internal
> (Karaf)
> > commands and external (system) commands.
> >
> > +1 to start to take a look on that on trunk.
> >
> > Regards
> > JB
> >
> >
> > On 12/28/2012 04:21 PM, Ioannis Canellos wrote:
> >
> >> I took a stub at creating a console text editor written in java based on
> >> jansi and jline.
> >>
> >> The current implementation is quite simple, loads the whole file into
> the
> >> memory and allows simple text editing operations, scrolling and also
> >> undo/redo, paste, save etc.
> >>
> >> There is a lot of cleaning up to do and a lot of space for improvements
> >> and
> >> I was wondering which would be the ideal home for this project.
> >>
> >> Thoughts?
> >>
> >>
> > --
> > Jean-Baptiste Onofré
> > jbono...@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
> >
>



-- 

Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
OPS4J Pax for Vaadin 
Commiter & Project Lead
blog 


Re: Text editing in the Karaf console

2012-12-28 Thread Andreas Pieber
TBH I would neither have a problem putting this directly on trunk. +1 from
my side.

Kind regards,
Andreas


On Fri, Dec 28, 2012 at 4:24 PM, Jean-Baptiste Onofré wrote:

> Hi Ioannis,
>
> it could be awesome to have a kind of vi in Karaf shell ;)
>
> It could be very interesting to mix your text editor with internal (Karaf)
> commands and external (system) commands.
>
> +1 to start to take a look on that on trunk.
>
> Regards
> JB
>
>
> On 12/28/2012 04:21 PM, Ioannis Canellos wrote:
>
>> I took a stub at creating a console text editor written in java based on
>> jansi and jline.
>>
>> The current implementation is quite simple, loads the whole file into the
>> memory and allows simple text editing operations, scrolling and also
>> undo/redo, paste, save etc.
>>
>> There is a lot of cleaning up to do and a lot of space for improvements
>> and
>> I was wondering which would be the ideal home for this project.
>>
>> Thoughts?
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>


Re: Text editing in the Karaf console

2012-12-28 Thread Jean-Baptiste Onofré

Hi Ioannis,

it could be awesome to have a kind of vi in Karaf shell ;)

It could be very interesting to mix your text editor with internal 
(Karaf) commands and external (system) commands.


+1 to start to take a look on that on trunk.

Regards
JB

On 12/28/2012 04:21 PM, Ioannis Canellos wrote:

I took a stub at creating a console text editor written in java based on
jansi and jline.

The current implementation is quite simple, loads the whole file into the
memory and allows simple text editing operations, scrolling and also
undo/redo, paste, save etc.

There is a lot of cleaning up to do and a lot of space for improvements and
I was wondering which would be the ideal home for this project.

Thoughts?



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Text editing in the Karaf console

2012-12-28 Thread Ioannis Canellos
I took a stub at creating a console text editor written in java based on
jansi and jline.

The current implementation is quite simple, loads the whole file into the
memory and allows simple text editing operations, scrolling and also
undo/redo, paste, save etc.

There is a lot of cleaning up to do and a lot of space for improvements and
I was wondering which would be the ideal home for this project.

Thoughts?

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*


Re: Text editing in the Karaf console

2012-12-03 Thread Ioannis Canellos
On windows its trickier than it seems.
The closest I got with edit is to open the edit inside Karaf and display
the contents of the file, but without being able to edit (and that worked
the first time, all other attempts were complete failures).
Also installing vim on windows and using the console vim mode, didn't seem
to work.
What did work was using the windowed version of the editor, but then again
that won't work via ssh.

I've added some patches to the jira for everyone who wants to experiment
with.
-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*


Re: Text editing in the Karaf console

2012-12-02 Thread Andreas Pieber
@Ioannis: That's a really great idea! You'll definitely have my Kudos for
that :-)

@Guillaume: Why unix specifc? You've e.g. edit in windows (as Ioannis
noticed).

@JB Executing native commands could be kind of dangerous. For example, just
because Karaf need some permissions to modify /etc/xyz you might don't like
your users to do so directly via Karaf (rm -rf /etc/xyz).

Kind regards,
Andreas

On Sun, Dec 2, 2012 at 10:35 PM, Jean-Baptiste Onofré wrote:

> Hi Ioannis,
>
> interesting, especially if it works with multiple platform.
>
> It could be tricky to "maintain" ;) but interesting for the users.
>
> Around the same area, I would like to add an escape character (like !) to
> execute native command directly from the Karaf shell (like !ls -l for
> instance).
>
> Regards
> JB
>
>
> On 12/02/2012 06:40 PM, Ioannis Canellos wrote:
>
>> Hi guys,
>>
>> One feature I've always liked to have in the karaf console is the ability
>> to edit text files. See https://issues.apache.org/**
>> jira/browse/KARAF-2044 
>>
>> I took a stub last night, to integrate existing editors that might be
>> present in the system with the Karaf console (e.g. vi, nano or edit in
>> windows).
>> To my surprise starting the editor as a new Process and wiring input and
>> output seems to just work.
>>
>> There are just a few things I'd like to solve before committing and I
>> wanted some ideas:
>>
>> i) I can pass the terminal height and width to the process, but how do I
>> get those values get updated if I resize while the editor is open?
>> ii) Some editor don't take kindly the delete character and prefer
>> backspace
>> (changing ascii 127 to ascii 8). Is this safe to do. Is there a better way
>> to handle it?
>> iii) After closing the editor, the console sometimes gets "flaky" arrow
>> keys might stop working etc.
>>
>> Thoughts?
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>


Re: Text editing in the Karaf console

2012-12-02 Thread Jean-Baptiste Onofré

Hi Ioannis,

interesting, especially if it works with multiple platform.

It could be tricky to "maintain" ;) but interesting for the users.

Around the same area, I would like to add an escape character (like !) 
to execute native command directly from the Karaf shell (like !ls -l for 
instance).


Regards
JB

On 12/02/2012 06:40 PM, Ioannis Canellos wrote:

Hi guys,

One feature I've always liked to have in the karaf console is the ability
to edit text files. See https://issues.apache.org/jira/browse/KARAF-2044

I took a stub last night, to integrate existing editors that might be
present in the system with the Karaf console (e.g. vi, nano or edit in
windows).
To my surprise starting the editor as a new Process and wiring input and
output seems to just work.

There are just a few things I'd like to solve before committing and I
wanted some ideas:

i) I can pass the terminal height and width to the process, but how do I
get those values get updated if I resize while the editor is open?
ii) Some editor don't take kindly the delete character and prefer backspace
(changing ascii 127 to ascii 8). Is this safe to do. Is there a better way
to handle it?
iii) After closing the editor, the console sometimes gets "flaky" arrow
keys might stop working etc.

Thoughts?



--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Text editing in the Karaf console

2012-12-02 Thread Guillaume Nodet
Interesting.  I had this in mind since a long time but had not thought
about bridging a native text editor.
One obvious downside is that this would kinda be unix specific ...

Now, as to your questions, you're going into dark areas here.  You've been
warned ;-)

On Sun, Dec 2, 2012 at 6:40 PM, Ioannis Canellos  wrote:

> Hi guys,
>
> One feature I've always liked to have in the karaf console is the ability
> to edit text files. See https://issues.apache.org/jira/browse/KARAF-2044
>
> I took a stub last night, to integrate existing editors that might be
> present in the system with the Karaf console (e.g. vi, nano or edit in
> windows).
> To my surprise starting the editor as a new Process and wiring input and
> output seems to just work.
>
> There are just a few things I'd like to solve before committing and I
> wanted some ideas:
>
> i) I can pass the terminal height and width to the process, but how do I
> get those values get updated if I resize while the editor is open?
>

If the connection is done through ssh, the native terminal on the other
side
will send events that could be intercepted.  However, when using a locale
console, there's no easy way to be notified afaik.


> ii) Some editor don't take kindly the delete character and prefer backspace
> (changing ascii 127 to ascii 8). Is this safe to do. Is there a better way
> to handle it?
> iii) After closing the editor, the console sometimes gets "flaky" arrow
> keys might stop working etc.
>

When creating a shell through ssh, the terminal configuration is passed
through ssh. Those parameters are available at
   org.apache.sshd.server.Environment#getPtyModes()
Now, the problem is to pass those terminal settings to the native process
and this should be done by calling stty to configure the terminal.
However, I'm not sure really what would happen when not using a real
terminal, i.e. when calling from ssh.  I suppose we'd have to create
a pseudo-terminal and use it, but i fear this kinda rely on fork/exec unix
stuff.

I initially had in mind rewriting the editor, but given the huge task, I
alwasy deferred it.  Interfacing with a real native terminal is certainly
easier, but the problems may be largely more difficult to solve, because
java is not really the best way to interface with unix executable.

Anyway, good work so far ...



>
> Thoughts?
>
> --
> *Ioannis Canellos*
> *
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Twitter: iocanel
> *
>



-- 

Guillaume Nodet

Blog: http://gnodet.blogspot.com/

FuseSource, Integration everywhere
http://fusesource.com


Text editing in the Karaf console

2012-12-02 Thread Ioannis Canellos
Hi guys,

One feature I've always liked to have in the karaf console is the ability
to edit text files. See https://issues.apache.org/jira/browse/KARAF-2044

I took a stub last night, to integrate existing editors that might be
present in the system with the Karaf console (e.g. vi, nano or edit in
windows).
To my surprise starting the editor as a new Process and wiring input and
output seems to just work.

There are just a few things I'd like to solve before committing and I
wanted some ideas:

i) I can pass the terminal height and width to the process, but how do I
get those values get updated if I resize while the editor is open?
ii) Some editor don't take kindly the delete character and prefer backspace
(changing ascii 127 to ascii 8). Is this safe to do. Is there a better way
to handle it?
iii) After closing the editor, the console sometimes gets "flaky" arrow
keys might stop working etc.

Thoughts?

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*