In ast ksh93 I am able to extend the first line of a multiline prompt
to the width of the terminal, using print -f and %${COLUMNS}s to format
the term and tty variables. This line expands and narrows if I adjust
the width of the terminal.

Here is the relevant excerpt from my PS1:

PS1='$(print -f "\n\e[1;7m%${COLUMNS}s\e[0m\n" "[$TERM] [$(tty)]"

The full prompt appears like this:

----------------------------------------------------------------------
                                                [xterm] [/dev/pts/0]
----------------------------------------------------------------------
[FQDN]
[53][~/org]
[gerard]$

Ignore the dashes; they are meant to represent the first line in
reverse video. This line is also right-aligned. Then I have hostname,
job number, path, and user.

I understand that print -f is not a feature of mksh. Is there another
way of achieving the desired result?

Thank you.

-- 
Gerard Lally

Reply via email to