* HISTSIZE and prompt
@ 1997-04-04 15:53 Zhong, Kaixiang
1997-04-04 16:29 ` Zefram
1997-04-05 7:36 ` gwing
0 siblings, 2 replies; 3+ messages in thread
From: Zhong, Kaixiang @ 1997-04-04 15:53 UTC (permalink / raw)
To: 'zsh-users@math.gatech.edu'
Hi:
I am using zsh-3.1.0 on HPUX.
In .zshrc, I set HISTSIZE to 100, and it does store previous 100
commands.
However, when I type history, it only shows last 16 commands.
Is there any other variables I should set?
Another thing I notices is:
if I set
1) 'setopt cdablevars ' to enable that the argument of cd can be an env
variable,
2) prompt='%~>'
3) mydir=/home/kzhong/dir/mydir
after I 'cd ~mybin', my prompt looks like "~mydir>"
but if I change 3) to
3) dir=/home/kzhong/dir/mydir
and after I 'cd ~dir', my prompt looks like "~/dir/mydir" instead of
"~dir".
How can I make it looks like "~dir"?
Thanks in advance.
Kai,
========================================================
Kai (Kaixiang) Zhong Phone: (617) 923-6669
Software Engineer Fax: (617) 923-5169
OneWave, Inc. or (617) 923-6565
1 Arsenal Marketplace, http://www.onewave.com
Watertown, MA, 02172 Email: kzhong@onewave.com
========================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: HISTSIZE and prompt
1997-04-04 15:53 HISTSIZE and prompt Zhong, Kaixiang
@ 1997-04-04 16:29 ` Zefram
1997-04-05 7:36 ` gwing
1 sibling, 0 replies; 3+ messages in thread
From: Zefram @ 1997-04-04 16:29 UTC (permalink / raw)
To: Zhong Kaixiang; +Cc: zsh-users
Zhong, Kaixiang wrote:
>In .zshrc, I set HISTSIZE to 100, and it does store previous 100
>commands.
>However, when I type history, it only shows last 16 commands.
>Is there any other variables I should set?
If you type "history 1" it will show you the entire history.
>3) dir=/home/kzhong/dir/mydir
>and after I 'cd ~dir', my prompt looks like "~/dir/mydir" instead of
>"~dir".
If you actually did "cd ~dir" then your prompt should look right. Did you
possibly do "cd ~/dir/mydir" or something similar? zsh will only display
the directory as "~dir" if you have already used "~dir" in a command.
-zefram
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: HISTSIZE and prompt
1997-04-04 15:53 HISTSIZE and prompt Zhong, Kaixiang
1997-04-04 16:29 ` Zefram
@ 1997-04-05 7:36 ` gwing
1 sibling, 0 replies; 3+ messages in thread
From: gwing @ 1997-04-05 7:36 UTC (permalink / raw)
To: Zhong Kaixiang; +Cc: zsh-users
Zhong, Kaixiang wrote:
:In .zshrc, I set HISTSIZE to 100, and it does store previous 100
:commands.
:However, when I type history, it only shows last 16 commands.
:Is there any other variables I should set?
>From the manual:
history
Same as fc -l
fc .... [ first [last ] ]
..... If first is not specified, it will be set
to -1 (the most recent event), or to -16 if the -l
flag is given .....
:Another thing I notices is:
:if I set
:1) 'setopt cdablevars ' to enable that the argument of cd can be an env
:variable,
:2) prompt='%~>'
:3) mydir=/home/kzhong/dir/mydir
:after I 'cd ~mybin', my prompt looks like "~mydir>"
:but if I change 3) to
:3) dir=/home/kzhong/dir/mydir
:and after I 'cd ~dir', my prompt looks like "~/dir/mydir" instead of
:"~dir".
:How can I make it looks like "~dir"?
I think there used to be (and may still be) something in the distribution
which was like this but with some other function name:
expanddir() { eval $1=$2; : ~$1 }
Then you would do:
% expanddir mydir /home/kzhong/dir/mydir
Of course, you could put some error checking in the function to check for the
right number of arguments, existance of $2 (and that it's a directory), etc.
>From the manual:
: [ arg ... ]
This command only expands parameters. A zero exit
code is returned.
Once you have used ``mydir'' as a named directory, ie. as ~mydir , it will be
used in your prompt as a named directory.
--
Geoff Wing [mason@primenet.com.au] Technical Manager
Phone : +61-3-9818 2977 PrimeNet - Internet Consultancy
Facsimile: +61-3-9819 3788 Web : <URL:http://www.primenet.com.au/>
Mobile : 0412 162 441
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-04-05 7:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-04 15:53 HISTSIZE and prompt Zhong, Kaixiang
1997-04-04 16:29 ` Zefram
1997-04-05 7:36 ` gwing
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).