On Thu, December 15, 2005 4:16 am, Philip Ganchev wrote: > On 12/14/05, Axel Liljencrantz <[EMAIL PROTECTED]> wrote: >> >> On Wed, December 14, 2005 7:49 am, Philip Ganchev wrote: >> > Is it possible to insert quoted characters in Fish, such as a bell? >> > ^V is the default readline keybinding, so ^V^G inserts a bell. >> >> Fish supports the standard C syntax for escaped characters, i.e. \xXX, >> \uXXXX or \UXXXXXXXX can be used to write an 8, 16 or 32 bit character >> using hex. \oXXX can be used to write a 8 bit character using octal. >> >> V is the 22:nd character of the alphabet, so ^V is character 22, or 16 >> hexadecimal. 'echo \x16' should work, I guess. > > \x16 does not work, it prints a garbage character, while "echo \u26" > prints "&".
I looked through the ascii table, and the bell character seems to be ^G, i.e. 7. So the correct code is 'echo \x7'. That works, just tested it. > > > Looking at the fish code, it seems that \b is also supported. Maybe > that >> works too? I'm too lazy to test since I have turned the bell of on my >> terminal. > > Yes, "echo -e '\a' " works. \b is backspace. The quotes around \a means it is echo that is doing the unescaping. Fish does not internally support \a, but I can add it. Makes sense. Are there any more missing escape sequences? > > It would be nice if escaped characters like \a and \x16 were > highlighted somehow, say in pink? I expect your Christmas Tree > objection - I suggested highlighting of strings earlier. I'd accept a patch! :-) > > Anyway, numbers are not very friendly as character names. The ^V > framework seems good because you can insert characters directly. For > example, > > bash> echo "hello<^V><Tab>world" > > inserts a tab character: > > bash> echo "hello world" > > Friendlier than a placeholder like \t, I think. > But rather limited in scope. You can't replace \x3, for example. -- Axel ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
