|
|
hum, it works so so
well, I really enjoy this tip, but I think that something is happening that shouldn't be.
hum, it works so so
Me too, the tip is cool, but ls, ll etc. all do daft things to the title...
I know why, but don't know a fix. Basically ls and ll etc are all defined as aliases -- type
which lsto see what I mean. Somehow, aliassed commands are being executed rather than used as strings. Try unalias lsand the effect for ls goes away. It stays for ll, though. I think an extra escape or single-quote is needed somewhere :-)
Problems with ls and ll investigated
OK, so I have now tracked down the bug further...
Problems with ls and ll FIX
make sure ls is defined as
Problems with ls and ll investigated
> as a quick check, making a script that does echo "foo",
Problems with ls and ll investigated
> Note: the n's in the first line should be preceded by
Problems with ls and ll investigated
Right. I've looked at the geeklog 1.1 script a bit, and apparently in plain text comments it eats slashes twice (so \\\\\\\\ becomes \\), and in html comments it eats slashes three times (so \\\\\\\\\\\\\\\\ becomes \\). When previewing, slashes are eaten once for plain and twice for html in the textarea, so when doing preview you should copy your text and re-paste before confirming the preview.
Problems with ls and ll investigated
Whoa, that's even weirder. What's shown in the preview area apparently isn't quite what goes into the saved comment. Hmmm.... Anyway, I guess it eats once for plain text and twice for html, so \\ becomes \ in plain text and \\\\ becomes \ in html
Problems with ls and ll investigated
the problem is that typing ls puts junk in the title bar (the output of ls).
Correct alias with no bugs?
the best illustration of what's wrong with the script
Correct alias with no bugs?
_or_ if you really want !# so that aliasses are expanded,
Correct alias with no bugs?
> if you really want !# so that aliasses are expanded,
>
> then
>
> alias postcmd echo "'^[]0;!#^G'"
>
> where the !# above is escaped with a backslash
> (don't know if geeklog will kill it though ;)
Ah, good! I had also noticed this "Faulty alias removed" problem, when you feed it an undefined variable. And indeed this seems to fix it. Provided, that is, I still include the sched part, thus:
sched +0:00 alias postcmd echo -n "'^[]0;!#^G'"(with backslash before the "!"). Otherwise, opening a new terminal gives me: Welcome to Darwin! echo: No match. Faulty alias 'postcmd' removed. [localhost:~] fz% That still leaves the ls problem open, though...
Correct alias with no bugs?
Actually this one still gives an error when the undefined variable is in quotes:
Correct alias with no bugs?
_or_ if you really want !# so that aliasses are expanded,
Correct alias with no bugs?
Works for me, no problem. At least ls is still displayed as ls, rather than the first line of the output (which is exactly what you DON'T want). I still wish it could display what directory, but hey there's always pwd and the prompt. ;)
Problems with ls and ll investigated
> printf '#! /bin/sh n echo "foo"' > test
hum, it works so so
Another use of this useful escape sequence
I don't need my window title changing to be the last command. Instead, I like to keep track of when I 'ssh' off to another box. Here's how I've implemented that (all of this is in my .cshrc file since I'm running tcsh):
alias winname "echo -n '^[]0;!^^G'" alias testbox "winname Connected to testbox;ssh testbox.com;winname Darwin" winname DarwinThis way when I log in, the window is automatically named "Darwin", then when I ssh out, it titles the window with the remote system name, and restores it to Darwin when I'm done.
Re: Another use of this useful escape sequence
That's a great idea. Here's how I'm implementing it: |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|