mirror of
https://github.com/zoriya/ash.git
synced 2026-05-31 18:03:54 +00:00
Implementing the ctrl L
This commit is contained in:
@@ -44,4 +44,6 @@ int end_of_line_command(int key, buffer_t *buffer, env_t *env);
|
||||
int up_history_command(int key, buffer_t *buffer, env_t *env);
|
||||
int down_history_command(int key, buffer_t *buffer, env_t *env);
|
||||
|
||||
int clear_screen_command(int key, buffer_t *buffer, env_t *env);
|
||||
|
||||
int complete_command(int key, buffer_t *buffer, env_t *env);
|
||||
@@ -75,4 +75,12 @@ int down_history_command(int key, buffer_t *buffer, env_t *env)
|
||||
buffer->history_index--;
|
||||
set_buffer_to_history(buffer, env);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int clear_screen_command(int key, buffer_t *buffer, env_t *env)
|
||||
{
|
||||
my_move(env->window, 0, 0);
|
||||
my_clrtobot();
|
||||
prompt_prepare(buffer, env);
|
||||
return (0);
|
||||
}
|
||||
@@ -23,6 +23,7 @@ const key_function_t key_functions[] = {
|
||||
{"up-history", &up_history_command},
|
||||
{"down-history", &down_history_command},
|
||||
{"complete-command", &complete_command},
|
||||
{"clear-screen", &clear_screen_command},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -39,6 +40,7 @@ const binding_t emacs_bindings[] = {
|
||||
{KEY_UP, &up_history_command},
|
||||
{KEY_DOWN, &down_history_command},
|
||||
{'\t', &complete_command},
|
||||
{CTRL('l'), &clear_screen_command},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user