Attached patch fixes a problem in command history:
In order to store the shell command history in the general ratpoison
history and to avoid forcing the user to remember which prompt some
program was started, the ratpoison history stores shell command lines
also in the general command history prefixed with the command in
question (e.g. exec).

The code in question has the problem that it always adds this when
a shell command is executed and not only when the shell command to
be executed was just entered. Thus an exec from some keybinding also
adds those into the history.

Attached patch should fix this.
>From 166021512b2e39344ff4562323d15a1e2fdea153 Mon Sep 17 00:00:00 2001
From: Bernhard R. Link <[email protected]>
Date: Sun, 31 May 2009 20:47:33 +0200
Subject: [PATCH] only add command to general history if it was entered interactively

---
 src/actions.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index 0f093a6..bb129ae 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1705,7 +1705,7 @@ read_shellcmd (struct argspec *spec, struct sbuf *s, struct cmdarg **arg, const
   cmdret *ret;
 
   ret = read_string (spec, s, hist_SHELLCMD, exec_completions, arg);
-  if (command_name && !ret) {
+  if (command_name && !s && !ret) {
     /* store for command history */
     char *s = xmalloc (strlen(command_name) + strlen((*arg)->string) + 2);
     sprintf (s, "%s %s", command_name, (*arg)->string);
-- 
1.5.6.5

_______________________________________________
Ratpoison-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/ratpoison-devel

Reply via email to