mirror of
https://github.com/zoriya/ash.git
synced 2025-12-06 06:36:17 +00:00
Reset attributes to remove bold style and adding history size in prompt
This commit is contained in:
@@ -32,6 +32,7 @@ int buffer_get_display_pos(buffer_t *buffer);
|
||||
int self_insert_command(int key, buffer_t *buffer, env_t *env);
|
||||
int newline_command(int key, buffer_t *buffer, env_t *env);
|
||||
int eof_command(int key, buffer_t *buffer, env_t *env);
|
||||
int history_size(history_t *hist);
|
||||
|
||||
int backward_delete_char_command(int key, buffer_t *buffer, env_t *env);
|
||||
int delete_char_command(int key, buffer_t *buffer, env_t *env);
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "shell.h"
|
||||
#include "my_ncurses.h"
|
||||
#include "prompt.h"
|
||||
#include "key_functions.h"
|
||||
#include "utility.h"
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
@@ -21,7 +23,7 @@ char *get_prompt_value2(char c, env_t *env)
|
||||
if (c == 'B')
|
||||
return (prompt_attr(BOLD, false));
|
||||
if (c == 'b')
|
||||
return (prompt_attr(BOLD, true));
|
||||
return (prompt_attr(0, false));
|
||||
if (c == 'U')
|
||||
return (prompt_attr(UNDERLINE, false));
|
||||
if (c == 'u')
|
||||
@@ -30,6 +32,8 @@ char *get_prompt_value2(char c, env_t *env)
|
||||
return (prompt_attr(REVERSE, false));
|
||||
if (c == 's')
|
||||
return (prompt_attr(REVERSE, true));
|
||||
if (c == '!' || c == 'h')
|
||||
return (tostr(history_size(env->history)));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user