zsh-users
 help / color / mirror / code / Atom feed
* History
@ 2002-09-10 17:30 GoTaR
  2002-09-10 19:25 ` History Paul Lew
  0 siblings, 1 reply; 11+ messages in thread
From: GoTaR @ 2002-09-10 17:30 UTC (permalink / raw)
  To: zsh-users

Hi!

How to make history not to remember some commands, like

$ cd [...]

?

PS. please follow reply-to, thanks.

-- 
GoTaR <gotar@priv0.onet.pl>
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: History
  2002-09-10 17:30 History GoTaR
@ 2002-09-10 19:25 ` Paul Lew
  2002-09-10 20:50   ` History Paul Ackersviller
  2002-09-11  5:39   ` History GoTaR
  0 siblings, 2 replies; 11+ messages in thread
From: Paul Lew @ 2002-09-10 19:25 UTC (permalink / raw)
  To: gotar; +Cc: zsh-users

>>>>> "GoTaR" == GoTaR  <gotar@poczta.onet.pl> writes:

    GoTaR> How to make history not to remember some commands, like

    GoTaR> $ cd [...]

Put a leading space before the command.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-10 19:25 ` History Paul Lew
@ 2002-09-10 20:50   ` Paul Ackersviller
  2002-09-10 21:52     ` History Wayne Davison
  2002-09-11  5:39   ` History GoTaR
  1 sibling, 1 reply; 11+ messages in thread
From: Paul Ackersviller @ 2002-09-10 20:50 UTC (permalink / raw)
  To: zsh-users

On Tue, Sep 10, 2002 at 12:25:07PM -0700, Paul Lew wrote:
> >>>>> "GoTaR" == GoTaR  <gotar@poczta.onet.pl> writes:
> 
>     GoTaR> How to make history not to remember some commands, like
> 
>     GoTaR> $ cd [...]
> 
> Put a leading space before the command.

That depends on the HIST_IGNORE_SPACE option, which isn't set by default.

-- 
Paul Ackersviller


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-10 20:50   ` History Paul Ackersviller
@ 2002-09-10 21:52     ` Wayne Davison
  0 siblings, 0 replies; 11+ messages in thread
From: Wayne Davison @ 2002-09-10 21:52 UTC (permalink / raw)
  To: Paul Ackersviller; +Cc: zsh-users

After setting the HIST_IGNORE_SPACE option, you can also define aliases
that represent commands that won't ever get stored in the history:
just define the alias expansion with a leading space.

For example, if you never want a "cd" command to appear in the history,
do this:

    setopt HIST_IGNORE_SPACE
    alias cd=' builtin cd'

..wayne..


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-10 19:25 ` History Paul Lew
  2002-09-10 20:50   ` History Paul Ackersviller
@ 2002-09-11  5:39   ` GoTaR
  2002-09-11  9:28     ` History Bart Schaefer
  1 sibling, 1 reply; 11+ messages in thread
From: GoTaR @ 2002-09-11  5:39 UTC (permalink / raw)
  To: Paul Lew; +Cc: zsh-users

On Tue, Sep 10, 2002 at 12:25:07 -0700, Paul Lew wrote:

>     GoTaR> How to make history not to remember some commands, like
> 
>     GoTaR> $ cd [...]
> 
> Put a leading space before the command.

I cannot do that. That command is

cd "`echo '\0057...'`"

and it's being called from Midnight Commander when switching panels.

-- 
GoTaR <gotar@priv0.onet.pl>
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-11  5:39   ` History GoTaR
@ 2002-09-11  9:28     ` Bart Schaefer
  2002-09-11 11:42       ` History GoTaR
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-09-11  9:28 UTC (permalink / raw)
  To: GoTaR; +Cc: zsh-users

On Sep 11,  7:39am, GoTaR wrote:
} Subject: Re: History
}
} On Tue, Sep 10, 2002 at 12:25:07 -0700, Paul Lew wrote:
} 
} >     GoTaR> How to make history not to remember some commands, like
} 
} cd "`echo '\0057...'`"
} 
} and it's being called from Midnight Commander when switching panels.

This is exactly the same question you asked back on July 11th, and the
answer hasn't changed:

	http://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=5155

Wayne just told you exactly the same thing:

	http://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=5339

Using the setopt and the alias -should- work with Midnight Commander.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-11  9:28     ` History Bart Schaefer
@ 2002-09-11 11:42       ` GoTaR
  2002-09-11 18:05         ` History Roman Neuhauser
  2002-09-14 21:22         ` History Bart Schaefer
  0 siblings, 2 replies; 11+ messages in thread
From: GoTaR @ 2002-09-11 11:42 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

On Wed, Sep 11, 2002 at 09:28:46 +0000, Bart Schaefer wrote:

> } >     GoTaR> How to make history not to remember some commands, like
> }
> } cd "`echo '\0057...'`"
> }
> } and it's being called from Midnight Commander when switching panels.
>
> This is exactly the same question you asked back on July 11th, and the
> answer hasn't changed:
[...]
> Using the setopt and the alias -should- work with Midnight Commander.

Yes, it works and removes _all_ 'cd' commands. I want to remove only
these, which match pattern 'cd "`echo .*`"'.
So removing from history is possible only by leading space, not by
configurable pattern, is it right? :/

-- 
GoTaR <gotar@priv0.onet.pl>		USA sux
	...Dżahilijja... znowu? Nadal...
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-11 11:42       ` History GoTaR
@ 2002-09-11 18:05         ` Roman Neuhauser
  2002-09-14 21:22         ` History Bart Schaefer
  1 sibling, 0 replies; 11+ messages in thread
From: Roman Neuhauser @ 2002-09-11 18:05 UTC (permalink / raw)
  To: zsh-users

# gotar@poczta.onet.pl / 2002-09-11 13:42:30 +0200:
> On Wed, Sep 11, 2002 at 09:28:46 +0000, Bart Schaefer wrote:
> 
> > } >     GoTaR> How to make history not to remember some commands, like
> > }
> > } cd "`echo '\0057...'`"
> > }
> > } and it's being called from Midnight Commander when switching panels.
> >
> > This is exactly the same question you asked back on July 11th, and the
> > answer hasn't changed:
> [...]
> > Using the setopt and the alias -should- work with Midnight Commander.
> 
> Yes, it works and removes _all_ 'cd' commands. I want to remove only
> these, which match pattern 'cd "`echo .*`"'.
> So removing from history is possible only by leading space, not by
> configurable pattern, is it right? :/

    why don't you start midc in a separate zsh instance with tweaked
    settings?

-- 
begin 666 nonexistent.vbs
FreeBSD 4.6-STABLE
8:05PM up 22 days, 1:58, 15 users, load averages: 0.07, 0.05, 0.01
end


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
  2002-09-11 11:42       ` History GoTaR
  2002-09-11 18:05         ` History Roman Neuhauser
@ 2002-09-14 21:22         ` Bart Schaefer
       [not found]           ` <20020915083631.GA334@os>
  1 sibling, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-09-14 21:22 UTC (permalink / raw)
  To: GoTaR; +Cc: zsh-users

On Sep 11,  1:42pm, GoTaR wrote:
} 
} So removing from history is possible only by leading space, not by
} configurable pattern, is it right? :/

That is correct.  There was some discussion several months ago of having
a pattern match for history exclusion, but it didn't lead to anything.

It is, however, possible to selectively insert into the history commands
that would otherwise be ignored.  Try something like this:

  setopt hist_ignore_space
  alias cd=' builtin cd'
  function preexec {
    if [[ "$1" = 'cd '* && "$1" != 'cd "`echo '*'`"' ]]
    then
      print -s "$1"	# explicitly add it to the history
    # else it already will be in the history, so do nothing
    fi
  }



-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: History
       [not found]           ` <20020915083631.GA334@os>
@ 2002-09-16  6:08             ` Bart Schaefer
  0 siblings, 0 replies; 11+ messages in thread
From: Bart Schaefer @ 2002-09-16  6:08 UTC (permalink / raw)
  To: zsh-users

On Sep 15, 10:36am, GoTaR wrote:
}
} I've found another solution. After
} 
} alias cd='builtin cd'
}          ^^
} (without space!) mc calls ' cd `echo "..."`' - it ommits 'builtin'
} keyword, so the command is leaded by space

That's very interesting.  It's not, as far as I can tell, a documented
behavior of Midnight Commander, so it's probably an accident.

I don't know if this thread is worthy of a zsh FAQ entry or not.  If it
is, it's probably worth mentioning that the MC_CONTROL_FILE environment
variable can be a clue that your rc files need to do different setup
(e.g., I wouldn't recommend using themed prompts within mc).  However,
it's only a clue, because not all compilations of mc export that, and
there doesn't appear to be anything mc consistently does to identify
itself to the subservient shell.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* History
@ 1997-11-07 19:43 Robert Vukovic
  0 siblings, 0 replies; 11+ messages in thread
From: Robert Vukovic @ 1997-11-07 19:43 UTC (permalink / raw)
  To: Zsh users list

   In history I get the following lines:

        precmd(){ pwd>&11;kill -STOP $$ }

   What does it mean ?
   Else I get blank lines in history which I don't wont.How can I get
rid of these lines.
   I have set these options:
	histignoredups
	histignorespace


   Robert Vukovic
vrobert@uns.ns.ac.yu



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-09-16  6:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-10 17:30 History GoTaR
2002-09-10 19:25 ` History Paul Lew
2002-09-10 20:50   ` History Paul Ackersviller
2002-09-10 21:52     ` History Wayne Davison
2002-09-11  5:39   ` History GoTaR
2002-09-11  9:28     ` History Bart Schaefer
2002-09-11 11:42       ` History GoTaR
2002-09-11 18:05         ` History Roman Neuhauser
2002-09-14 21:22         ` History Bart Schaefer
     [not found]           ` <20020915083631.GA334@os>
2002-09-16  6:08             ` History Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1997-11-07 19:43 History Robert Vukovic

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).