How to clear the screen correctly in ksh

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to clear the screen correctly in ksh

Максим
Hello
In bash I can press Ctrl-l to clear the screen.
In ksh this key combination does not work. I can clear the screen only
using the command "clear".

How can I do this using hotkeys in ksh?
And how to do this when in vi mode?

I tried a workaround by assigning the key combination to Ctrl-l to cwm:
cat .cwmrc
unbind-key C-l
bind-key C-l "/usr/bin/clear"
After reloading cwm there is no effect.

-- 
Maksim Rodin

Reply | Threaded
Open this post in threaded view
|

Re: How to clear the screen correctly in ksh

Alexis

Максим <[hidden email]> writes:

> In bash I can press Ctrl-l to clear the screen.
> In ksh this key combination does not work. I can clear the
> screen only
> using the command "clear".
>
> How can I do this using hotkeys in ksh?

i have this in my .kshrc:

    bind -m '^L=^Uclear^J^Y'


Alexis.

Reply | Threaded
Open this post in threaded view
|

Re: How to clear the screen correctly in ksh

Joseph Mayer

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, 4 July 2019 16:39, Alexis <[hidden email]> wrote:

> Максим [hidden email] writes:
> > In bash I can press Ctrl-l to clear the screen.
> > In ksh this key combination does not work. I can clear the
> > screen only
> > using the command "clear".
> > How can I do this using hotkeys in ksh?
>
> i have this in my .kshrc:
>
> bind -m '^L=^Uclear^J^Y'
>
> Alexis.

As far as I am aware, since about 6 months ksh clears the screen on
ctrl+L by default, no bind is needed anymore?

Reply | Threaded
Open this post in threaded view
|

Re: How to clear the screen correctly in ksh

Stuart Henderson
In reply to this post by Максим
On 2019-07-04, Максим <[hidden email]> wrote:

> Hello
> In bash I can press Ctrl-l to clear the screen.
> In ksh this key combination does not work. I can clear the screen only
> using the command "clear".
>
> How can I do this using hotkeys in ksh?
> And how to do this when in vi mode?
>
> I tried a workaround by assigning the key combination to Ctrl-l to cwm:
> cat .cwmrc
> unbind-key C-l
> bind-key C-l "/usr/bin/clear"
> After reloading cwm there is no effect.
>
> -- 
> Maksim Rodin
>
>

Update to 6.5.

(Or if, like me, you hate the ^L = clear behaviour, restord the previous
behaviour with "bind ^L=redraw").

Reply | Threaded
Open this post in threaded view
|

Re: How to clear the screen correctly in ksh

Alexis
In reply to this post by Joseph Mayer

Joseph Mayer <[hidden email]> writes:

> As far as I am aware, since about 6 months ksh clears the screen
> on
> ctrl+L by default, no bind is needed anymore?

You're right; it's specifically stated in the Changelog for 6.5:

  https://www.openbsd.org/plus65.html

which apparently i didn't read closely enough. :-/


Alexis.

Reply | Threaded
Open this post in threaded view
|

Re: How to clear the screen correctly in ksh

Максим
In reply to this post by Stuart Henderson
Hello,
Thanks for the hint, it really works out of the box on 6.5
I did not notice it because I use vi mode in ksh which does not seem
to know about this key combination. In man ksh there is no option for the vi
mode.

-- 
Maksim Rodin


04.07.2019, 12:59, "Stuart Henderson" <[hidden email]>:

> On 2019-07-04, Максим <[hidden email]> wrote:
>>  Hello
>>  In bash I can press Ctrl-l to clear the screen.
>>  In ksh this key combination does not work. I can clear the screen only
>>  using the command "clear".
>>
>>  How can I do this using hotkeys in ksh?
>>  And how to do this when in vi mode?
>>
>>  I tried a workaround by assigning the key combination to Ctrl-l to cwm:
>>  cat .cwmrc
>>  unbind-key C-l
>>  bind-key C-l "/usr/bin/clear"
>>  After reloading cwm there is no effect.
>>
>>  --
>>  Maksim Rodin
>
> Update to 6.5.
>
> (Or if, like me, you hate the ^L = clear behaviour, restord the previous
> behaviour with "bind ^L=redraw").