[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash stays in the secondary prompt (PS2) after completing a command

From: Eduardo Bustamante
Subject: Re: Bash stays in the secondary prompt (PS2) after completing a command with `edit-and-execute-command'
Date: Fri, 12 May 2017 07:57:36 -0500

On Fri, May 12, 2017 at 7:42 AM, Eduardo Bustamante <address@hidden> wrote:
> Bash is still in `parse_matched_pair'-

This *seems* to fix it, but I actually have no clue if this is
correct, or if more cleanup is required prior to the longjmp. I also
removed `rl_forced_update_display ()', because otherwise Bash will
display an awkward PS2 just before displaying PS1 again.

address@hidden:~/src/gnu/bash$ git diff -- bashline.c
diff --git a/bashline.c b/bashline.c
index 7884416a..1b59af91 100644
--- a/bashline.c
+++ b/bashline.c
@@ -937,7 +937,6 @@ edit_and_execute_command (count, c, editing_mode,
   char *command, *metaval;
   int r, rrs, metaflag;
-  sh_parser_state_t ps;

   rrs = rl_readline_state;
   saved_command_line_count = current_command_line_count;
@@ -973,9 +972,7 @@ edit_and_execute_command (count, c, editing_mode,

   if (rl_deprep_term_function)
     (*rl_deprep_term_function) ();
-  save_parser_state (&ps);
   r = parse_and_execute (command, (editing_mode == VI_EDITING_MODE) ?
"v" : "C-xC-e", SEVAL_NOHIST);
-  restore_parser_state (&ps);
   if (rl_prep_term_function)
     (*rl_prep_term_function) (metaflag);

@@ -989,7 +986,7 @@ edit_and_execute_command (count, c, editing_mode,
   rl_done = 0;
   rl_readline_state = rrs;

-  rl_forced_update_display ();
+  jump_to_top_level (DISCARD);

   return r;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]