On Sat, Aug 14, 2021 at 08:56:37AM +1000, Cameron Simpson wrote: > On 13Aug2021 08:17, Chris Green <c...@isbd.net> wrote: > >On Fri, Aug 13, 2021 at 08:15:26AM +0200, Alexander Dahl wrote: > >> On Thu, Aug 12, 2021 at 08:30:11AM +0100, Chris Green wrote: > >> > I read my mail (via ssh) on quite a variety of devices, one is an > >> > Android phone running termux which has rather short lines which > >> > truncate much of the subject in index view. > >> > > >> > I could rearrange the index_format but that would change it for all my > >> > viewing devices and I don't really want to do that, and anyway I'd > >> > still lose some information. > >> > >> What about a macro or shortcut to toggle between different settings? > >> > >That's possible but it's just one more thing that one has to to > >manually which isn't really necessary. > > I always invoke via a script (named "+") which has assorted > figure-it-out logic before invoking mutt. You could sniff the terminal > size and choose a narrower index_format for narrow terminals. (_And_ > bind that to a keyboard toggle macro as well if you wanted.) > > I've got a ttysize script which does this: > > stty -a </dev/tty \ > | sed -n ' > s/.* rows \([0-9][0-9]*\); columns \([0-9][0-9]*\).*/\2 \1/p > t > s/.*; *\([0-9][0-9]*\) rows; *\([0-9][0-9]*\) columns.*/\2 \1/p > t' > > but I'm sure there must be a more direct way. > > Anyway, given the tty width you could make a choice about index_format. > Yes, of course some sort of wrapper could handle it. "stty -a" works perfectly well in termux on Android, gives me 48 columns by default.
Thanks -- Chris Green