[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Destroyed table with `tabs -4`
From: |
Thomas Dickey |
Subject: |
Re: Destroyed table with `tabs -4` |
Date: |
Wed, 13 Feb 2019 18:49:55 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Feb 13, 2019 at 09:54:54PM +0100, Frank Brütting wrote:
> Hi,
>
> I have `tabs -4` in my `.bashrc`, because that’s what is used everywhere.
> Sadly however, this destroys the output of all applications which use
> `ncurses`.
But it's not a bug in ncurses. Very briefly:
The tabs command can set hardware tab-stops (those need not be the same
size). ncurses can be configured to use hardware tab-stops (and by the
way, that's not a default setting).
These items in terminfo(5) are relevant:
init_tabs it it tabs initially every
# spaces
clear_all_tabs tbc ct clear all tab stops
(P)
set_tab hts st set a tab in every
row, current columns
tab ht ta tab to next 8-space
hardware tab stop
While the information needed to _set_ tab-stops is in the terminal
database, that tells curses applications only what the _initial_
tab-size is. There's no completely portable way for curses to determine
what the tabs program did.
When you used
tabs -4
that made the terminal behave differently (from curses standpoint) than the
it#8
value in the terminal description. curses (SVr4 curses, ncurses, NetBSD)
all provide a library variable TABSIZE which an application could set to
reflect a tab-size which was set externally. Otherwise, they all use the
initial-tabs value from the terminal database. There's no environment
variable for this in SVr4 curses or ncurses. With a little imagination,
you can see how an environment variable for it would be more trouble than
it's worth.
That's been documented for quite a while (July 2000 in curs_addch.3x,
September 2010 in curs_variables.3x). I see some places to improve
the documentation, but no code or database change is needed.
You could use a custom terminal description for this, with
it#4
For anything more involving varying tab-sizes
(the tabs manual page shows several),
there's no curses (or similar) library that does this.
> See my more detailed bug report here, for example:
> https://github.com/gnunn1/tilix/issues/1616#issuecomment-453881648
I see (nothing useful there).
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature