On 8/22/06, Martin Bähr <[EMAIL PROTECTED]> wrote: > On Tue, Aug 22, 2006 at 01:54:11AM +0200, Axel Liljencrantz wrote: > > 1) Up/down arrows to move in the history > > 2) Incremental search > > 3) !-commands, like !1, etc. > > Hence, all 3 are kind of lame. > > agreed > > > * You can start the search halfway into entering a command, when you > > realize that you've written this command before. I do this all the > > time. > > my commands are usually so similar to each other that this does not gain > me much, i still have to use up-arrow a lot to find the one i am looking > for. that is also made less practical because the commandline is not > wrapped, which means ihave to scroll left/right to see the full command. > with 80 columns in the terminal this is not very convenient. > > that said, half of the time i find myself trying to use fish style > history in a bash.
I won't be happy until you never find yourself using bash. :) > > > I am not really interested in 'easy, temprorary fixes', since these > > tend to become permanent. I think the current functionality is good > > enough that we can take the time to get history access right if we are > > to change it. > > I don't want 3 differnent history access systems. I'd like having only > > 1 the best, but absolutely not more than 2. > > i fully agree. > > > The current up/down arrow system is, in my experience, very > > discoverable. If the fish history mechanism is changed, this property > > must be retained. > > indeed. > > you didn't address my two (hidden) questions: Indeed. Done below. > namely for a command that just prints the history to stdout, The $history environment variable contains the last 10 entries form the history list in reverse order (ie.e $history[1] is the latest entry). It would be easy to extend this to contain the entire history. Would a builtin command be better? > and a way for the commandline function to just return the token under > the curser (that may be there, but then i can't figure it out) 'commandline -t' should do just that. BTW, if you are experimenting with keybindings, you might want to create ~/.fish_inputrc containg the following: $include /etc/fish_inputrc "\M-x": eval (read --prompt "set_color green; echo command; set_color normal; echo ': '" -l old; echo $old) That lets you use Meta-x to enter a new command, which can in turn operate to the contents of the previous commandline. Nice for testing code that should go into keybinding functions. > > the latter may not be necessary, but the history command would allow it > to write functions that manipulate the history in interresting ways > which would allow to experiment with different ways to access the > history, without making those functions part of the release of fish. Ah, that is a good point. The history variable is read-only. The only problem I see with making it writable is that the fact that fish automatically removes duplicate entries might cause subtle confusion when items change index unexpectedly. But that is a minor point. > that way, if someone really insisted on getting their !style (which i > never used, because i find it just way to obscure, it is probably from > the days when ed was state of the art for text editing) they could just > implement their own function to do it without bothering the rest of us > who want something different. Sure. Along a related path, it was suggested some time ago that event hooks be added that are fired before a commandline command is executed. That way a sed script could be run on the commandline before executing it, which would transform Posix shellscript into fish shellscript. That is definitely not something which belongs inside the main fish tarball, but making fish extensible enough to allow you to do things like that would be pretty cool. If you have a design for a complete replacemnt of the current history search, or a separate system that completemnts the current system in a nice way and is significantly more powerful, feel free to provide a detailed description. > > greetings, martin. > -- > cooperative communication with sTeam - caudium, pike, roxen and unix > offering: programming, training and administration - anywhere in the world > -- > pike programmer travelling and working in europe open-steam.org > unix system- bahai.or.at iaeste.(tuwien.ac|or).at > administrator (caudium|gotpike).org is.schon.org > Martin Bähr http://www.iaeste.or.at/~mbaehr/ > -- Axel ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
