[PATCH] Already running a command (& subshell prompt?)



Hi,

Removing the odd code executed on Ctrl-o in invoke_subshell() the
"Already running a command" issue on C-o, tab, tab, n, C-o, <command>
seems to be fixed. But maybe there are other scenarios in which it can
be reproduced.

I totally got rid of the subshell state ACTIVE as it is unused except in
the removed code snippet. I didn't quite get the three state logic
anyway. Maybe the author wanted to indicate a difference between "panel
view" and "panels hidden view"?

Does this perhaps also fix the subshell prompt issue? See the comment /*
Hack to make prompt reappear */ in the removed code.

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

src/Changelog:
	subshell.c (invoke_subshell): Remove bad subshell hack on C-o.
	subshell.h: Remove unused subshell state ACTIVE

--- src/subshell.c.000	2004-11-07 13:42:53.000000000 +0100
+++ src/subshell.c	2004-11-17 01:36:05.000000000 +0100
@@ -528,13 +528,7 @@ int invoke_subshell (const char *command
     
     if (command == NULL)  /* The user has done "C-o" from MC */
     {
-	if (subshell_state == INACTIVE)
-	{
-	    subshell_state = ACTIVE;
-	    /* FIXME: possibly take out this hack; the user can
-	       re-play it by hitting C-hyphen a few times! */
-	    write (subshell_pty, " \b", 2);  /* Hack to make prompt reappear */
-	}
+	;
     }
     else  /* MC has passed us a user command */
     {
--- src/subshell.h.000	2002-12-24 01:13:44.000000000 +0100
+++ src/subshell.h	2004-11-17 01:36:27.000000000 +0100
@@ -14,7 +14,7 @@ extern int use_subshell;
 extern int subshell_pty;
 
 /* State of the subshell; see subshell.c for an explanation */
-enum subshell_state_enum {INACTIVE, ACTIVE, RUNNING_COMMAND};
+enum subshell_state_enum {INACTIVE, RUNNING_COMMAND};
 extern enum subshell_state_enum subshell_state;
 
 /* Holds the latest prompt captured from the subshell */


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