EC_EDITLINE_SET_PROMPT_ESC(3)

NAME
ec_editline_set_prompt_esc - Set editline escaped prompt.

SYNOPSIS
#include <ecoli/editline.h>

int ec_editline_set_prompt_esc(
    struct ec_editline   *editline,  /* The pointer to the ec_editline structure. */
    const char           *prompt,    /* The prompt string to use. */
    char                  delim      /* The start/stop literal prompt character. */
);

DESCRIPTION

From el_set(3):

If the start/stop delim character is found in the prompt, the character itself is not printed, but characters after it are printed directly to the terminal without affecting the state of the current line. A subsequent second start/stop literal character ends this behavior. This is typically used to embed literal escape sequences that change the color/style of the terminal in the prompt. Note that the literal escape character cannot be the last character in the prompt, as the escape sequence is attached to the next character in the prompt.

RETURN VALUE

0 on success, or -1 on error.

SEE ALSO

ec_editline_get_el(3), ec_editline_set_prompt(3), ec_editline_complete(3), ec_editline_parse(3), ec_editline_free(3), ec_editline_term_size(3), ec_editline_gets(3), ec_editline_interact(3), ec_editline_set_node(3), ec_editline_set_history(3), ec_editline(3), ec_editline_get_node(3), ec_editline_curline(3)

COPYRIGHT

Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.