how to insert <CR> in ratpoison -c colon command
Michael <[email protected]>
| Newsgroups | gmane.comp.window-managers.ratpoison.devel |
|---|---|
| Message-ID | <20091202130643.GA4685@harryhaller> |
I'm working on using DMENU for entering colon commands - it helps jog the memory;-) A problem I've encountered is with colon dialogs. For example describekey. Here is the crude dialog (after command has been selected from dmenu): response="$(ratpoison -c "$item")" if [ ! "$response" = "" ]; then ratpoison -c "echo $response" fi For a straight forward command like "info" this works. But if I run "definekey" without giving the keymap, it does nothing - I get neither a dialog appearing nor with the code above can I catch the error message and display it so that I know why there's been no response. I thought that by using the "colon" command, I could enter the "colon" dialog and solve this problem. So I changed the code thus: response="$(ratpoison -c "colon $item")" if [ ! "$response" = "" ]; then ratpoison -c "echo $response" fi The problem here is that I have to press enter twice - once after selecting from dmenu and then again when the colon prompt appears. I've tried the following: response="$(ratpoison -c "colon $item"\n)" response="$(ratpoison -c "colon $item ")" Neither works - in both cases (and variations, including \r) the carriage return turns up as a literal on the colon command line. I don't understand why I can't catch the error message with my original coding above either. Sorry if this sounds like a trivial question - I'm hoping there is a simple answer that I've missed. BTW - ratpoison is really the best wm I've encountered - but I think we, here on this list, all know that - but still, I wanted to say it.:) Michael