several issues + wishes

Oswald Buddenhagen ossi at kde.org
Tue Feb 18 21:12:58 UTC 2003


i had one more thought ...

On Tue, Feb 18, 2003 at 11:53:32AM +0100, Oswald Buddenhagen wrote:
> > > a cmdline switch to replace the "mc" prefix in the window title would be
> > > very helpful. i usually have dozens of xterms with mc open, some of them
> > > are root consoles and some on remote hosts. it's impossible to manage
> > > them if they are all titled "mc - ...".
> > 
> > I think an environment variable would be better.  Something like PS1, but
> > specific to mc.  Then you would set it in .profile on the remote host.
> >
> no. a) it complicates things like "xterm -e su -c 'mc --title root'", as
> i need to set up the variable first somehow (note that sh does not
> source any files in non-interactive mode by default)
>
valid

> and b) i don't want a "remotehost" title when i'm working locally on
> the other host.
>
nonsense. the "xterm -e ssh remotehost mc --title remote" case is already
covered by a), and the "log in interactively, start mc" case is the same
with both a var and a switch (i'd set up a shell function to do the
right thing based on login origin).

but i found, that appending to the already existing title would be very
helpful (i hope you can get the title query working):
 xterm -T konsole1
 xterm -T konsole2
 xterm -T root -e su
 xterm -T ktown -e ssh ktown
 xterm -e mc
 xterm -e mc --title mc2
in the interactive shells mc is aliased to 'mc --append-title'. think 
"konsole1: mc - ~". the benefit is obvious, i think.
--title "" would remove the "mc -" part entirely to save some space in
the task bar.

to carry things to excess: --title could interpret macros like these:
 %o - old title
 %f - currently open dir/file
 %a - current status ("" (=view), "edit")
 %F - currently processes dir/file
 %A - precise current status (as %a + the usual file operations)
 %{[var]?[text1]:[text2]} - if var (see above) is non-empty, text1,
      otherwise text2 (both subject to further expansion).
one could create things like this:
 "%{o?%o (mc):mc}: %{a?%a :}%f"
or the normal variant, but optimized for prefix size (for narrow task
bar entries) (btw, most apps use "%f - title" order):
 "%{o?%o\: :}%f - mc"
or for the pedantic:
 "mc%{o? (%o):} - %{A?%A:view} %F"


greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.



More information about the mc-devel mailing list