Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  shell line buffer behavior

jdavisp3
Posted: Sun Mar 07, 2010 6:16 pm Reply with quote
User Joined: 03 Feb 2008 Posts: 21
Here's some work to make the Erlang shell history
more like readline:

git fetch git://github.com/jdavisp3/otp.git shell

Specifically:

1. Blank lines are not added to the line buffer.

2. Pressing the down arrow on the last line causes no change.

The previous behavior erased the line.

3. The new line is temporarily added to the line buffer
so the user can move to previous lines with up arrows
and then back to the new line with down arrows.

The previous behavior discarded the partially written
new line.

4. Changes made to previous lines while exploring the line
buffer history are preserved.

The previous behavior discarded changes made to older lines.

Any interest in this?

thanks,
dave

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Sun Mar 07, 2010 6:16 pm Reply with quote
User Joined: 03 Feb 2008 Posts: 21
Here's some work to make the Erlang shell history
more like readline:

git fetch git://github.com/jdavisp3/otp.git shell

Specifically:

1. Blank lines are not added to the line buffer.

2. Pressing the down arrow on the last line causes no change.

The previous behavior erased the line.

3. The new line is temporarily added to the line buffer
so the user can move to previous lines with up arrows
and then back to the new line with down arrows.

The previous behavior discarded the partially written
new line.

4. Changes made to previous lines while exploring the line
buffer history are preserved.

The previous behavior discarded changes made to older lines.

Any interest in this?

thanks,
dave

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
Guest
Posted: Mon Mar 08, 2010 2:51 pm Reply with quote
Guest
Absolutely, yes

On 2010-03-07, at 1:15 PM, Dave Peticolas wrote:

> Here's some work to make the Erlang shell history
> more like readline:
>
> git fetch git://github.com/jdavisp3/otp.git shell
>
> Specifically:
>
> 1. Blank lines are not added to the line buffer.
>
> 2. Pressing the down arrow on the last line causes no change.
>
> The previous behavior erased the line.
>
> 3. The new line is temporarily added to the line buffer
> so the user can move to previous lines with up arrows
> and then back to the new line with down arrows.
>
> The previous behavior discarded the partially written
> new line.
>
> 4. Changes made to previous lines while exploring the line
> buffer history are preserved.
>
> The previous behavior discarded changes made to older lines.
>
> Any interest in this?
>
> thanks,
> dave
>
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org
>

Brendan Doyle
Manager, Application Development
Epic Advertising - New York, Toronto, San Francisco, London
www.EpicAdvertising.com
60 Columbia Way, Suite 310
Markham, ON L3R 0C9
(905) 946-0300 x.2358 work
(647) 885-7159 mobile
(888) 666-3120 fax
brendan.doyle@epicadvertising.com


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Mon Mar 08, 2010 2:51 pm Reply with quote
Guest
Absolutely, yes

On 2010-03-07, at 1:15 PM, Dave Peticolas wrote:

> Here's some work to make the Erlang shell history
> more like readline:
>
> git fetch git://github.com/jdavisp3/otp.git shell
>
> Specifically:
>
> 1. Blank lines are not added to the line buffer.
>
> 2. Pressing the down arrow on the last line causes no change.
>
> The previous behavior erased the line.
>
> 3. The new line is temporarily added to the line buffer
> so the user can move to previous lines with up arrows
> and then back to the new line with down arrows.
>
> The previous behavior discarded the partially written
> new line.
>
> 4. Changes made to previous lines while exploring the line
> buffer history are preserved.
>
> The previous behavior discarded changes made to older lines.
>
> Any interest in this?
>
> thanks,
> dave
>
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org
>

Brendan Doyle
Manager, Application Development
Epic Advertising - New York, Toronto, San Francisco, London
www.EpicAdvertising.com
60 Columbia Way, Suite 310
Markham, ON L3R 0C9
(905) 946-0300 x.2358 work
(647) 885-7159 mobile
(888) 666-3120 fax
brendan.doyle@epicadvertising.com


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Mon Mar 08, 2010 3:25 pm Reply with quote
Guest
On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
> Here's some work to make the Erlang shell history
> more like readline:

The killer feature here is if you can make it record the shell history
between invocations (maybe in ~/.erl_history).

Thanks!

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Mon Mar 08, 2010 3:25 pm Reply with quote
Guest
On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
> Here's some work to make the Erlang shell history
> more like readline:

The killer feature here is if you can make it record the shell history
between invocations (maybe in ~/.erl_history).

Thanks!

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Spectra
Posted: Mon Mar 08, 2010 9:20 pm Reply with quote
User Joined: 08 Dec 2008 Posts: 54 Location: Australia
Winston Smith wrote:
> On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
>
>> Here's some work to make the Erlang shell history
>> more like readline:
>>
>
> The killer feature here is if you can make it record the shell history
> between invocations (maybe in ~/.erl_history).
>
For anyone who hasn't found it, there's a great little utility (on
Linux, at least) called 'rlwrap' which gives you the full readline
feature set on any command line system (like, say, the erlang shell). I
simply have 'erl' aliased to 'rlwrap -a erl'. It gives you everything
provided by this patch as well as as a searchable history (just like you
get in bash with Ctrl-r).

(This isn't meant to suggest that the patch isn't worthwhile, just to
note an alternative).

Cheers,

Bernard

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
Spectra
Posted: Mon Mar 08, 2010 9:20 pm Reply with quote
User Joined: 08 Dec 2008 Posts: 54 Location: Australia
Winston Smith wrote:
> On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
>
>> Here's some work to make the Erlang shell history
>> more like readline:
>>
>
> The killer feature here is if you can make it record the shell history
> between invocations (maybe in ~/.erl_history).
>
For anyone who hasn't found it, there's a great little utility (on
Linux, at least) called 'rlwrap' which gives you the full readline
feature set on any command line system (like, say, the erlang shell). I
simply have 'erl' aliased to 'rlwrap -a erl'. It gives you everything
provided by this patch as well as as a searchable history (just like you
get in bash with Ctrl-r).

(This isn't meant to suggest that the patch isn't worthwhile, just to
note an alternative).

Cheers,

Bernard

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Tue Mar 09, 2010 3:19 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
Winston Smith wrote:
> On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
>> Here's some work to make the Erlang shell history
>> more like readline:
>
> The killer feature here is if you can make it record the shell history
> between invocations (maybe in ~/.erl_history).

That's what I plan on working on next, assuming there's general
interest in this work, which there seems to be.


> Thanks!
>


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Tue Mar 09, 2010 3:19 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
Winston Smith wrote:
> On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
>> Here's some work to make the Erlang shell history
>> more like readline:
>
> The killer feature here is if you can make it record the shell history
> between invocations (maybe in ~/.erl_history).

That's what I plan on working on next, assuming there's general
interest in this work, which there seems to be.


> Thanks!
>


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Tue Mar 09, 2010 3:20 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
Bernard Duggan wrote:
> Winston Smith wrote:
>> On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
>>
>>> Here's some work to make the Erlang shell history
>>> more like readline:
>>>
>> The killer feature here is if you can make it record the shell history
>> between invocations (maybe in ~/.erl_history).
>>
> For anyone who hasn't found it, there's a great little utility (on
> Linux, at least) called 'rlwrap' which gives you the full readline
> feature set on any command line system (like, say, the erlang shell). I
> simply have 'erl' aliased to 'rlwrap -a erl'. It gives you everything
> provided by this patch as well as as a searchable history (just like you
> get in bash with Ctrl-r).

That's a cool utility, thanks.


> (This isn't meant to suggest that the patch isn't worthwhile, just to
> note an alternative).

Yep, I think it might still be useful for systems you can't install
extra stuff to.

> Cheers,
>
> Bernard
>


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message
jdavisp3
Posted: Tue Mar 09, 2010 3:20 am Reply with quote
User Joined: 03 Feb 2008 Posts: 21
Bernard Duggan wrote:
> Winston Smith wrote:
>> On Sun, Mar 7, 2010 at 1:15 PM, Dave Peticolas <dave@krondo.com> wrote:
>>
>>> Here's some work to make the Erlang shell history
>>> more like readline:
>>>
>> The killer feature here is if you can make it record the shell history
>> between invocations (maybe in ~/.erl_history).
>>
> For anyone who hasn't found it, there's a great little utility (on
> Linux, at least) called 'rlwrap' which gives you the full readline
> feature set on any command line system (like, say, the erlang shell). I
> simply have 'erl' aliased to 'rlwrap -a erl'. It gives you everything
> provided by this patch as well as as a searchable history (just like you
> get in bash with Ctrl-r).

That's a cool utility, thanks.


> (This isn't meant to suggest that the patch isn't worthwhile, just to
> note an alternative).

Yep, I think it might still be useful for systems you can't install
extra stuff to.

> Cheers,
>
> Bernard
>


________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
Post new topic

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum