From the Archives 2

July 21st, 2006

From December 2, 2005:

More Eterm. Turns out the next item on the agenda is not to get the End key working, but to get something more helpful than “Eterm” to appear in the title bar. This is where we start to get into some dark magic. Here’s the prompt I’m using right now, after some hair pulling and tweaking:
PS1=”\[\e]2;\u@\h \W\a\][\u@\h \W]\$ “
That’s just craziness. How do we decipher this and bend it to our will? I found a very helpful site by IBM here.

Just for grins, I shall unravel this statement. first, let’s expand some thing.
\u = your username
\h = first part of your hostname
\W = the name of the the current working directory
\$ = $ if you are not root, # if you are.

Basically what we have here is the same prompt twice. First it is wrapped in \[\e]2; and \a\]. Then we have the same thing again, plus the \$. I’ll get back to this, but what we basically get is “[username@hostname current-dir]$”. For example, “[josterpi@gandalf docs]$ “

Get back to the first part: \[\e]2;TITLEBAR\a\] puts TITLEBAR in the title bar of the terminal. Exactly what I wanted to do. I ran into a very wierd problem though. As I was typing commands, it would wrap around onto the same line, so that I was writing over what I had just writting. Very annoying. It turns out that the problem I had was that I wasn’t wrapping the title bar section in \[ and \]. What the escaped brackets do is indicate to the shell that what is in the brackets should no be considered when calculating word wrapping, which is what I was having trouble with. That is, the stuff between the brackets is non-printing. We would have to use brackets if if we were using escape sequences for color or whatever else.

Next I’ll have to explain how I was able to use escape sequences to dynamically toggle my Eterm from black-on-white to white-on-black using escape sequences and key bindings.

Also, I’ve done some neat stuff with key bindings in fluxbox and figuring out the keycodes for a couple of my IBM thinkpad specific keys. More later…or not.

From the Archives 1

July 21st, 2006

Going to copy-paste some posts I want to keep from the old blog. Finding that blog is left as an exercise for the reader.

From December 1, 2005:

I’ve started using Eterm and Fluxbox. One thing that annoys me about Eterm is that it scrolls one page at a time when when I scroll with the mouse. I just figured out how to change this. It took far longer than it should have, and Google was no help. So, hopefully this should be of help to whoever finds this

It’s simple, really. In your user.cfg file (probably in .Eterm/themes/Eterm/user.cfg) Go the the actions section and add these two lines:
bind button5 to script ’scroll(2l)’
bind button4 to script ’scroll(-2l)’
This will have Eterm scroll two lines instead of one page. I like two lines. You can change it to whatever you want. Here’s my whole action section, for context:
begin actions
bind ctrl shift button3 to string ‘^[]6;14^G’
bind ctrl button3 to menu “Eterm”
bind ctrl button2 to string ‘^[[?30t’
bind ctrl button1 to string ‘^[]5;^G’
bind button5 to script ’scroll(2l)’
bind button4 to script ’scroll(-2l)’
end actions

Next on the agenda, figure out how to make my End key work.

(For those who are familiar with my blog, you won’t be interested in this. I’m just writing this in the hopes that someone will stumble across it and be saved the frustration I went through in getting this to work.)

kick-off

July 21st, 2006

Turns out installing a Wordpress blog is a piece of cake. Why didn’t I do this before? Of course, now I need to take the time to come up with a less generic template.