09-08-2009
1,
0
Join Date: Sep 2009
Last Activity: 8 September 2009, 8:06 PM EDT
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
Confused by history in tcsh
I discovered tcsh recently and I am having a very good time with it, except I can't understand how to use the history search features: history-search-backward and i-search-back. To wit:
- history-search-backward (M-p, M-P)
Searches backwards through the history list for a command beginning with the current contents of the input buffer up to the cursor and copies it into the input buffer.
OK, it works, but it only matches lines in the history that BEGIN with whatever I have in the buffer. What if I want to match something in the middle of a past command line? It seems I can achieve that typing *string* then pressing the history-search-backward key, but that is rather annoying. Is there an easier way?
- i-search-back (not bound - but I chose M-q)
Searches backward like history-search-backward, copies the first match into the input buffer with the cursor positioned at the end of the pattern, and prompts with 'bck: ' and the first match. Additional characters may be typed to extend the search, i-search-back may be typed to continue searching with the same pattern, wrapping around the history list if necessary, (i-search-back must be bound to a single character for this to work) or one of the following special characters may be typed:
^W: Appends the rest of the word under the cursor to the search pattern.
OK, it works up to the point when I get the bck: prompt. Then, it seems to search very nicely as long as my buffer is empty. If anything is typed, I have an upper buffer and a lower buffer and I can't seem to make sense of that. Pressing ^W makes the mess even worse. In case my buffer (upper) is not empty, it seems to work just the same, the buffer is just ignored, but my incremental search is appended to the existing buffer. Well, I have absolutely no idea what is going on whenever I try to use that feature. I would be very grateful if someone would take the time to "translate" that mechanism into plain English to me.
- Last, but not least, I keep losing my history! I configured my prompt so it always displays my history line count, I set it to a very high number (999 -- I really like the history in my shell), and every now and then, I log in or just open a new tab in my console application (Yakuake) and the history count has been reset to 1. Why??? Is there some routine in tcsh that discards all the history periodically or could that be some sort of bug? I am using tcsh 6.17.00 by the way. Freshly downloaded and compiled from tcsh.org/MostRecentRelease
Many thanks in advance.