#include <stdio.h>
+#ifdef __MSDOS__
+# include <pc.h>
+#endif
+
/* System-specific feature definitions and include files. */
#include "rldefs.h"
#include "rlmbutil.h"
}
else
{ /* delta < 0 */
+#ifdef __MSDOS__
+ int row, col;
+
+ fflush (rl_outstream); /* make sure the cursor pos is current! */
+ ScreenGetCursor (&row, &col);
+ ScreenSetCursor (row + delta, col);
+ i = -delta; /* in case someone wants to use it after the loop */
+#else /* !__MSDOS__ */
if (_rl_term_up && *_rl_term_up)
for (i = 0; i < -delta; i++)
tputs (_rl_term_up, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
}
_rl_last_v_pos = to; /* Now TO is here */
int pchar;
{
int len;
- char *pmt;
+ char *pmt, *p;
rl_save_prompt ();
- if (saved_local_prompt == 0)
+ /* We've saved the prompt, and can do anything with the various prompt
+ strings we need before they're restored. We want the unexpanded
+ portion of the prompt string after any final newline. */
+ p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
+ if (p == 0)
{
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
pmt = (char *)xmalloc (len + 2);
}
else
{
- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
+ p++;
+ len = strlen (p);
pmt = (char *)xmalloc (len + 2);
if (len)
- strcpy (pmt, saved_local_prompt);
+ strcpy (pmt, p);
pmt[len] = pchar;
pmt[len+1] = '\0';
- local_prompt = savestring (pmt);
- prompt_last_invisible = saved_last_invisible;
- prompt_visible_length = saved_visible_length + 1;
- }
+ }
+ /* will be overwritten by expand_prompt, called from rl_message */
prompt_physical_chars = saved_physical_chars + 1;
-
return pmt;
}
_rl_clear_to_eol (count)
int count;
{
+#ifndef __MSDOS__
if (_rl_term_clreol)
tputs (_rl_term_clreol, 1, _rl_output_character_function);
- else if (count)
+ else
+#endif
+ if (count)
space_to_eol (count);
}
void
_rl_clear_screen ()
{
+#if defined (__GO32__)
+ ScreenClear (); /* FIXME: only works in text modes */
+ ScreenSetCursor (0, 0); /* term_clrpag is "cl" which homes the cursor */
+#else
if (_rl_term_clrpag)
tputs (_rl_term_clrpag, 1, _rl_output_character_function);
else
rl_crlf ();
+#endif
}
/* Insert COUNT characters from STRING to the output stream at column COL. */