*/
-#define TEST
+//#define TEST
#ifndef TEST
static void cmdedit_setwidth(int w, int redraw_flg)
{
cmdedit_termw = cmdedit_prmt_len + 2;
+ if (w <= cmdedit_termw) {
+ cmdedit_termw = cmdedit_termw % w;
+ }
if (w > cmdedit_termw) {
cmdedit_termw = w;
redraw((new_y >= cmdedit_y ? new_y : cmdedit_y), len - cursor);
fflush(stdout);
}
- } else {
- error_msg("\n*** Error: minimum screen width is %d",
- cmdedit_termw);
- }
+ }
}
extern void cmdedit_init(void)
setTermSettings(inputFd, (void *) &new_settings);
handlers_sets |= SET_RESET_TERM;
- cmdedit_init();
/* Print out the command prompt */
parse_prompt(prompt);
+ /* Now initialize things */
+ cmdedit_init();
while (1) {
** atexit() handlers and other unwanted stuff to our
** child processes (rob@sysgo.de)
*/
- cmdedit_init();
cmdedit_read_input(prompt_str, command);
- free(prompt_str);
cmdedit_terminate();
+ free(prompt_str);
return 0;
#else
fputs(prompt_str, stdout);
** atexit() handlers and other unwanted stuff to our
** child processes (rob@sysgo.de)
*/
- cmdedit_init();
cmdedit_read_input(prompt_str, command);
- free(prompt_str);
cmdedit_terminate();
+ free(prompt_str);
return 0;
#else
fputs(prompt_str, stdout);
*/
-#define TEST
+//#define TEST
#ifndef TEST
static void cmdedit_setwidth(int w, int redraw_flg)
{
cmdedit_termw = cmdedit_prmt_len + 2;
+ if (w <= cmdedit_termw) {
+ cmdedit_termw = cmdedit_termw % w;
+ }
if (w > cmdedit_termw) {
cmdedit_termw = w;
redraw((new_y >= cmdedit_y ? new_y : cmdedit_y), len - cursor);
fflush(stdout);
}
- } else {
- error_msg("\n*** Error: minimum screen width is %d",
- cmdedit_termw);
- }
+ }
}
extern void cmdedit_init(void)
setTermSettings(inputFd, (void *) &new_settings);
handlers_sets |= SET_RESET_TERM;
- cmdedit_init();
/* Print out the command prompt */
parse_prompt(prompt);
+ /* Now initialize things */
+ cmdedit_init();
while (1) {
** atexit() handlers and other unwanted stuff to our
** child processes (rob@sysgo.de)
*/
- cmdedit_init();
cmdedit_read_input(prompt_str, command);
- free(prompt_str);
cmdedit_terminate();
+ free(prompt_str);
return 0;
#else
fputs(prompt_str, stdout);