Lumail - The console email client

Lua primitives: prompt_chars()

NOTE: Lumail-legacy has been superseded by Lumail 2.x, which has a wholly unified Lua API.

The bottom row of the lumail mail-client is designated as the message area, but it is also used to prompt for input.

The prompt_chars() function allows you to query a user for input. The function will keep reading keypresses, without the need for RETURN to be pressed, until one of the keys pressed matches a character given in the character string.

The return value will be the single character the user entered.


prompt_chars( "The prompt to display", "Valid characters to accept" );

For example:

entered = prompt_chars( "my prompt will accept A, B, or C", "ABC" );
msg( "You entered: " .. entered );

You'll notice that prompt_yn is just a special case of this function.


This function has been available since version 0.09.

See Also

See also choose_string, prompt, prompt_maildir, prompt_yn.