Re: cursor keys not working on console

2013-08-08 Thread Thomas Dickey
On Thu, Aug 08, 2013 at 07:53:04PM +0200, O. Hartmann wrote:
> The cursor keys on the consoles in freebsd CURRENT (no X11 virtual
> consoles, the FreeBSD consoles!) do not work for me.
> 
> I use tcsh as the main shell.
> As set by default in /etc/ttys, the console's terminal type is xterm.
> Switching to 
> 
> setenv TERM cons25
> 
> solves the problem, but the menus in ports via make config look ugly
> and more ugly, but they are unusable with the setting "TERM=xterm".
> 
> What is wrong here? Why are the cursor keys not working in the
> console/ports menu as expected when using tcsh/csh as default shell?

from infocmp (cons25 vs xterm):

kcub1: '\E[D', '\EOD'.
kcud1: '\E[B', '\EOB'.
kcuf1: '\E[C', '\EOC'.
kcuu1: '\E[A', '\EOA'.

It's probably 

http://invisible-island.net/ncurses/ncurses.faq.html#cursor_appmode

You would probably find
TERM=xterm-noapp

and improvement.

-- 
Thomas E. Dickey 
http://invisible-island.net
ftp://invisible-island.net


signature.asc
Description: Digital signature


Re: bsdinstall(8) line drawing characters

2013-01-20 Thread Thomas Dickey
On Sun, Jan 20, 2013 at 04:03:31PM +0100, David Lazaro Saz wrote:
> 
> On Jan 20, 2013, at 2:50 PM, Devin Teske  wrote:
> 
> > Of interest I would think is the output of:
> > 
> > dialog --version
> > echo $TERM
> > 
> > and whether (if possible) sysinstall produces similar results (what release 
> > are you running?)
> 
> I'm still running 8.3 in production. I've noticed this while playing with 9.0 
> and 9.1 both on vmware and older machines.
> 
> I think that you are right and it has to do with the TERM variable and how it 
> is set in the system console. In 8.3, the system console is defined as 
> "cons25" while on 9.1 it is defined as "xterm". If I execute the following 
> command:
> 
> # TERM=cons25 bsdinstall
> 
> Then the line drawing characters are show correctly on the system console. If 
> I do the opposite on 8.3, defining TERM as xterm, then the results are even 
> worse than on 9.1.
> 
> dialog(1) is on version 1.1-20100428 on 9.1 and on version 0.3 on 8.3.
> 
> I can't find neither when nor why the system console was changed to xterm
> looking at the release notes of FreeBSD 9.0, but this seem to be the reason. 
> The TERM variable is defined on /etc/ttys, so I'll try to find the change on
> the svn repository to shed some light.

TERM is one thing, the driver is another.

Since the "xterm" terminal description supports line-drawing characters,
it sounds as if the underlying problem is in the console driver.

ncurses would use ASCII characters if it is told that the terminal
cannot use line-drawing characters.  However, it uses the VT100
line-drawing characters if possible.

Running vttest establishes that the issue is not in ncurses
(menu item 3, character sets).  That shows only ASCII characters.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpijyiZrJThA.pgp
Description: PGP signature


Re: Xterm options for correct man page display?

2012-10-07 Thread Thomas Dickey
On Sun, Oct 07, 2012 at 09:09:13AM +0100, Jamie Paul Griffin wrote:
> [ Thomas Dickey wrote on Sat  6.Oct'12 at  7:32:00 -0400 ]
> 
> > On Sat, Oct 06, 2012 at 07:31:07AM -0400, Thomas Dickey wrote:
> > > On Sat, Oct 06, 2012 at 10:45:52AM +0100, Jamie Paul Griffin wrote:
> > > > [ Ronald F. Guilmette wrote on Sat  6.Oct'12 at  2:25:04 -0700 ]
> > > > 
> > > > > 
> > > > > When I view man pages in a xterm window, some parts of them are coming
> > > > > out a bit garbled.
> > > > > 
> > > > > I'm sure that there must be some recommended option or options for
> > > > > xterm that will cause man pages to display properly.  If someone would
> > > > > tell me what those options are, I would appreciate it.  Thanks.
> > > > 
> > > > It will most likely be due to your locale settings. Also, I 
> > > > experimented with fonts in xterm and uxterm, only the default font 
> > > > allowed unicode charaters to display, so I am now using urxvt and it 
> > > > works great. I also changed my pager option in the shell start up file 
> > > > to less as opposed to more, and set lesscharset environment variable, 
> > > > man pages display fine now for me.
> > > 
> > > For people using UTF-8, the uxterm script works out of the box...
> > > 
> > > The usual problem with fonts is from overwriting the utf8Fonts resource
> > > setting via a too-wide "fonts" wildcard pattern.
> > 
> > For example
> > 
> > http://invisible-island.net/xterm/xterm.faq.html#utf8_fonts
> 
> Hi Thomas - is understand what your saying about uxterm - it does display
> utf8 fonts correctly when leaving the font resource alone, but the default
> font is very small, too small for my eyes. 
> 
> I installed a large number of utf8 supported X fonts, the ones I've tried
> don't display Chinese or Korean, or Russian fonts etc.  It became a little
> frustrating which made me change to another terminal.  The link you provided
> doesn't appear to be active.  Would you be kind enough to show the resource
> settings you have used?

Well - the default size is a compromise (there are people who apparently
use the smallest size regularly - looking at urxvt out-of-the-box, it's
true there)(*).  I generally use the font-size switching feature which I
adapted from rxvt (one of the features which was omitted in urxvt),
and switch to one of the two largest sizes using shift-keypad-plus.
There are differences in the default fonts' coverage for CJK fonts,
but between those two sizes I can see almost all characters.
 
> I spent a long time reading through the man page and trying out different
> resource settings and combinations of them, European fonts were never a
> problem, just the east Asian characters and Russian characters as I
> mentioned.

I haven't noticed a problem (with uxterm) for Russian characters - more
info might help.
 
> I've set my locale to en_GB.UTF-8 using /etc/login.conf and then cap_mkdb
> /etc/login.conf.  As I said in my previous email, urxvt has no problem
> displaying these characters but I'd like to get uxterm working properly none
> the less, as I'm sure the OP does as well.

(*) the default size when switching to TrueType fonts is roughly what I
use normally for the bitmap fonts (much larger than the default), and
I should have made it consistent.  It's configurable, and I later
added a note in the manpage explaining how to do this...

The default font for xterm has "always" been the "fixed" font, which
as noted above I find too small for normal use.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpYK34OzfQUd.pgp
Description: PGP signature


Re: Xterm options for correct man page display?

2012-10-06 Thread Thomas Dickey
On Sat, Oct 06, 2012 at 10:45:52AM +0100, Jamie Paul Griffin wrote:
> [ Ronald F. Guilmette wrote on Sat  6.Oct'12 at  2:25:04 -0700 ]
> 
> > 
> > When I view man pages in a xterm window, some parts of them are coming
> > out a bit garbled.
> > 
> > I'm sure that there must be some recommended option or options for
> > xterm that will cause man pages to display properly.  If someone would
> > tell me what those options are, I would appreciate it.  Thanks.
> 
> It will most likely be due to your locale settings. Also, I experimented with 
> fonts in xterm and uxterm, only the default font allowed unicode charaters to 
> display, so I am now using urxvt and it works great. I also changed my pager 
> option in the shell start up file to less as opposed to more, and set 
> lesscharset environment variable, man pages display fine now for me.

For people using UTF-8, the uxterm script works out of the box...

The usual problem with fonts is from overwriting the utf8Fonts resource
setting via a too-wide "fonts" wildcard pattern.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp7olkEfKQJo.pgp
Description: PGP signature


Re: Xterm options for correct man page display?

2012-10-06 Thread Thomas Dickey
On Sat, Oct 06, 2012 at 07:31:07AM -0400, Thomas Dickey wrote:
> On Sat, Oct 06, 2012 at 10:45:52AM +0100, Jamie Paul Griffin wrote:
> > [ Ronald F. Guilmette wrote on Sat  6.Oct'12 at  2:25:04 -0700 ]
> > 
> > > 
> > > When I view man pages in a xterm window, some parts of them are coming
> > > out a bit garbled.
> > > 
> > > I'm sure that there must be some recommended option or options for
> > > xterm that will cause man pages to display properly.  If someone would
> > > tell me what those options are, I would appreciate it.  Thanks.
> > 
> > It will most likely be due to your locale settings. Also, I experimented 
> > with fonts in xterm and uxterm, only the default font allowed unicode 
> > charaters to display, so I am now using urxvt and it works great. I also 
> > changed my pager option in the shell start up file to less as opposed to 
> > more, and set lesscharset environment variable, man pages display fine now 
> > for me.
> 
> For people using UTF-8, the uxterm script works out of the box...
> 
> The usual problem with fonts is from overwriting the utf8Fonts resource
> setting via a too-wide "fonts" wildcard pattern.

For example

http://invisible-island.net/xterm/xterm.faq.html#utf8_fonts

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp8Yoa4tvIpJ.pgp
Description: PGP signature


Re: Does 9.0 honor TERM settings

2012-08-24 Thread Thomas Dickey
On Fri, Aug 24, 2012 at 11:38:38AM +0200, J B wrote:
> > Well, then, where is the setting that makes the F7 key send E[18~ instead
> > of the standard E[S?
> 
> I think you will find a hint here:
> https://wiki.archlinux.org/index.php/Home_and_End_keys_not_working

it's not much of a hint (it's Linux-specific, and like most of the Arch
wiki - not insightful).

(other responses in the thread seem to have answered the question)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpL3GAW9IKHM.pgp
Description: PGP signature


Re: termcap/terminfo magicians anyone? // colors in vim

2012-05-30 Thread Thomas Dickey
On Wed, May 30, 2012 at 05:33:27PM +0400, Peter Vereshagin wrote:
> Hello.
> 
> Being new from linux back in time I tried vim. It had pretty colors in linux 
> for me like that:
> 
> http://www.postimg.com/71000/photo-70938.jpg
> 
> But in freebsd I have what I have:
> 
> http://www.postimg.com/71000/photo-70939.jpg
> 
> It 'just works' for me if I 'vim -T linux' but:
> 
> - I'd like to know exact reason to be fixed other than just 'use linux'
> - It shows colors in ttyvX with TERM=cons25 but it has random '25h'
>   showing up in places when I implement the actions from the begin of
>   vimtutor.

If you tell vim that it's "linux" when it is really cons25, that confuses it. 
A "linux" console recognizes an particular escape sequence ending with "25h"
for making the cursor visible (ending with "25l" for invisible).  vim likes to
use that.  cons25 doesn't support it.

As noted in vim's manpage, the -T option should be used only if the
automatic way (setting $TERM correctly) doesn't work.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpj6Yh3B2Vea.pgp
Description: PGP signature


Re: Editor With NO Shell Access?

2012-03-12 Thread Thomas Dickey
On Mon, Mar 12, 2012 at 02:19:06PM -0500, Tim Daneliuk wrote:
> I have a situation where I need to provide people with the ability to edit
> files.  However, under no circumstances do I want them to be able to exit
> to the shell.   The client in question has strong (and unyielding) InfoSec
> requirements in this regard.
> 
> So ... are there editors without this feature?  Can I compile something like
> joe or vi to inhibit this feature?

man vi (see "-S")

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpJTSE7KtVaE.pgp
Description: PGP signature


Re: Terminal (TERM=xterm) on FreeBSD doesn not accept DEL or ALT key on/in a Linux YAST2 session

2012-03-12 Thread Thomas Dickey
On Mon, Mar 12, 2012 at 03:30:58PM +0100, O. Hartmann wrote:
> > And you are using xterm (not rxvt)?
> 
> No, pure and plain and conservative xterm as it comes with the port and
> no extravagant terminal thingy.

Linux generally uses DEL (127) and (almost) everyone else uses BS (8).
Adding to the confusion, most keyboards label it "Backspace".

Most (but not all) applications on a given host are consistent with
the choice (or accept either code).  There are exceptions, of course.

With xterm, you can use control/Backspace to toggle between the two
(for one keypress), or use the control/left-mouse menu to toggle the
"Backarrow Key (BS/DEL)" entry.
 
-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpDPKal5B5Nj.pgp
Description: PGP signature


Re: Terminal (TERM=xterm) on FreeBSD doesn not accept DEL or ALT key on/in a Linux YAST2 session

2012-03-12 Thread Thomas Dickey
On Mon, Mar 12, 2012 at 11:43:17AM -0400, Alejandro Imass wrote:
> Take a look at this article and you will probably fix the problem, and
> it's probably not even on the FBSD side:
> 
> www.ibb.net/~anne/keyboard.html

not really (that page gives a lot of poor advice, particularly with regard
to xterm).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp09mjj8DUHz.pgp
Description: PGP signature


Re: No colours at all with ncurses and urxvt on FreeBSD 9.0-RC2

2011-11-25 Thread Thomas Dickey
On Fri, Nov 25, 2011 at 06:58:21PM +0100, Moritz Wilhelmy wrote:
> On Fri, Nov 25, 2011 at 08:19:15 -0500, Thomas Dickey wrote:
> > well... rxvt-unicode-256color was the effect of the checkins for termcap.src
> > for conf/152713 and conf/153164
> > 
> > The earlier one suggests that the naming came from rxvt-unicode's sources.
> > Checking that, it seems that the rxvt-unicode entry specifies 88 colors,
> > while the rxvt-unicode-256color entry (close to rxvt-256color) does 256.
> > 
> > However, the rxvt-unicode entry in FreeBSD was added for conf/117323,
> > which equated it to rxvt-mono (no color), with some changes for 
> > function-keys.
> > 
> > On the other hand, the rxvt entry uses color, which was overlooked in
> > conf/117323:
> > 
> > # Termcap entry for rxvt-unicode, taken from 
> > http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.html#I_need_a_termcap_file_entry
> > rxvt-unicode|rxvt-unicode terminal (X Window System):\
> > :SF=\E[%dS:SR=\E[%dT:bw:ec=\E[%dX:kb=\177:kd=\EOB:ke=\E[?1l\E>:\
> > :kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:lm#0:te=\E[r\E[?1049l:\
> > :ti=\E[?1049h:tc=rxvt-mono:
> 
> And I already wondered why it was so short..

It's short because most of the content is in "rxvt-mono" (that "tc=" acts
as an include).
 
> > rxvt|rxvt terminal emulator (X Window System):\
> > :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:

this also is short - the main difference between the two is that the
latter has features for color (pa, Co, AF, AB and op).

> > Following the clue from the comment, the example using no color was present
> > in rxvt.7 until it was removed in version 9.05 of rxvt-unicode.  The current
> > documentation contains no examples (the termcap/terminfo are only separate
> > files).
> 
> This sounds like a bug in FreeBSD's default termcap. Should I file a PR?

yes - 

-- 
Thomas E. Dickey 
http://invisible-island.net
ftp://invisible-island.net


signature.asc
Description: Digital signature


Re: No colours at all with ncurses and urxvt on FreeBSD 9.0-RC2

2011-11-25 Thread Thomas Dickey
On Fri, Nov 25, 2011 at 01:02:15PM +0100, Moritz Wilhelmy wrote:
> On Fri, Nov 25, 2011 at 06:37:18 -0500, Thomas Dickey wrote:
> > On Fri, Nov 25, 2011 at 11:59:01AM +0100, Moritz Wilhelmy wrote:
> > > I can't get colours to work with urxvt (the "normal" urxvt, that is, not
> > > the 256-color one) over ssh. Google doesn't come up with any usable
> > > results for this particular case.. What bothers me is that a termcap
> > > entry for "rxvt-unicode" is present on the termcap file FreeBSD came
> > > with. I'm really clueless here, can someone give me a hint?
> > 
> > setting TERM to rxvt-256color looks like the way to fix that issue.
> 
> Indeed, setting TERM to either "rxvt-256color" or "rxvt" gives me
> colours.  The remaining question is, why doesn't it work with
> "rxvt-unicode", which is also in the termcap file?

well... rxvt-unicode-256color was the effect of the checkins for termcap.src
for conf/152713 and conf/153164

The earlier one suggests that the naming came from rxvt-unicode's sources.
Checking that, it seems that the rxvt-unicode entry specifies 88 colors,
while the rxvt-unicode-256color entry (close to rxvt-256color) does 256.

However, the rxvt-unicode entry in FreeBSD was added for conf/117323,
which equated it to rxvt-mono (no color), with some changes for function-keys.

On the other hand, the rxvt entry uses color, which was overlooked in
conf/117323:

# Termcap entry for rxvt-unicode, taken from 
http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.html#I_need_a_termcap_file_entry
rxvt-unicode|rxvt-unicode terminal (X Window System):\
:SF=\E[%dS:SR=\E[%dT:bw:ec=\E[%dX:kb=\177:kd=\EOB:ke=\E[?1l\E>:\
:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:lm#0:te=\E[r\E[?1049l:\
:ti=\E[?1049h:tc=rxvt-mono:

rxvt|rxvt terminal emulator (X Window System):\
:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:

Following the clue from the comment, the example using no color was present
in rxvt.7 until it was removed in version 9.05 of rxvt-unicode.  The current
documentation contains no examples (the termcap/terminfo are only separate
files).

-- 
Thomas E. Dickey 
http://invisible-island.net
ftp://invisible-island.net


signature.asc
Description: Digital signature


Re: No colours at all with ncurses and urxvt on FreeBSD 9.0-RC2

2011-11-25 Thread Thomas Dickey
On Fri, Nov 25, 2011 at 11:59:01AM +0100, Moritz Wilhelmy wrote:
> Hello,
> 
> I can't get colours to work with urxvt (the "normal" urxvt, that is, not
> the 256-color one) over ssh. Google doesn't come up with any usable
> results for this particular case.. What bothers me is that a termcap
> entry for "rxvt-unicode" is present on the termcap file FreeBSD came
> with. I'm really clueless here, can someone give me a hint?

setting TERM to rxvt-256color looks like the way to fix that issue.

-- 
Thomas E. Dickey 
http://invisible-island.net
ftp://invisible-island.net


signature.asc
Description: Digital signature


Re: nice man pages?

2011-10-26 Thread Thomas Dickey
On Wed, Oct 26, 2011 at 10:23:57AM -0700, Carl Johnson wrote:
> Thomas Dickey  writes:
> 
> > fwiw, without also setting the NC capability (something like NC#35),
> > it'll confuse curses/ncurses since that conflicts with the normal
> > color controls.
> 
> Thanks, I had missed that description in the terminfo(5) manpage.  It
> worked fine without it, but that might have been just because I hadn't
> been using enough colors.  I put it in but there is no change for my
> applications.

To explain - since you're using colors to replace some of the video
attributes, a curses application (less isn't one) will occasionally
reset either a color or a "video attribute", supposing them to be
distinct.

(I don't have a demo in mind, but know that's how the code works...).

Using NC, then curses applications will prefer using colors over the
video attributes.  (Again, less wouldn't be affected, since it's not
trying to do more than one thing at a time on the screen).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpnQ0VIUEw6b.pgp
Description: PGP signature


Re: nice man pages?

2011-10-26 Thread Thomas Dickey
On Tue, Oct 25, 2011 at 08:58:19PM -0700, Carl Johnson wrote:
> Patrick Lamaiziere  writes:
> 
> > Hello,
> >
> > I use sysutils/most to have nice manual pages in color, that's cool but
> > is there a way to do this with the base system (ie without adding port)?
> 
> I use a colorized termcap with less, but it also works with
> /usr/bin/more.  It depends on what type of terminal you are using it
> on.  I have it for xterm and rxvt (which is what I use).  This works for
> manpages, but you can also colorize your prompt.
> 
> It is short, so my ~/.termcap is below:
> 
> -- snip ---
> # this is just changes to the standard FreeBSD termcaps - 2010-12-13 cdj
> 
> xterm|xterm-color|X11 terminal emulator:\
> :md=\E[33;1m:so=\E[36;1m:se=\E[0m:us=\E[32;4m:ue=\E[0;24m:\
> :ti@:te@:tc=xterm-xfree86:
> 
> rxvt|rxvt terminal emulator (X Window System):\
> :md=\E[33;1m:so=\E[36;1m:se=\E[0m:us=\E[32;4m:ue=\E[0;24m:\
> :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:\
> :tc=rxvt-mono:
> -- snip ---
> 
> All that does is set bold to yellow, standout to cyan, and underline to
> green.  I use white on black, so if you use something else you will
> probably have to adjust the colors.  I haven't tried 9.0, but this works
> on 8.1-RELEASE and 8.2-RELEASE.  You can decide for yourself if that
> does what you want.

fwiw, without also setting the NC capability (something like NC#35),
it'll confuse curses/ncurses since that conflicts with the normal
color controls.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp8hVuuMKfnJ.pgp
Description: PGP signature


Re: Updating emacs fails

2011-10-24 Thread Thomas Dickey
On Mon, Oct 24, 2011 at 08:32:30AM +0200, John R. Levine wrote:
> >>It sounds to me like the right thing to do is to fix emacs' configuration
> >>so it always uses the base system ncurses whether or not the package
> >>version is there.  Right?
> >
> >maybe/maybe not.  It depends on what emacs needs - whether it only works
> >with either its own termcap module or a conventional termcap library in
> >the system.  Probably its installation documentation tells what's needed.
> 
> If you look at the build log I posted, it's failing because it's trying to 
> link in the system termcap library and failing because ncurses doesn't 
> provide it.

In other places, "-ltermcap" is symlinked to -lncurses

("provide" can be taken in more than one way - the functions are always
available, whether or not the port is written to use them).

A quick look at the emacs 23.3 sources shows various things relevant to
ncurses:
a) the configure script makes a special check on netbsd to use
   ncurses rather than the termcap library.
b) it has a very old comment suggesting where to get the terminfo
   or termcap sources (pre-1997).
c) the NEWS file points out that LIBS_TERMCAP is either terminfo
   or termcap.
d) src/s/freebsd.h defines LIBS_TERMCAP to -lncurses unless the
   system is before FreeBSD 4.0
e) src/Makefile.in uses machine.h (in this case derived from the
   previously-mentioned file).

There's enough in the emacs sources to make it pretty clear that a
failure to have emacs find the termcap functions would be a problem
in the emacs port - emacs prefers -lncurses to -ltermcap unless it's
being overridden.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpMGBWQidJAa.pgp
Description: PGP signature


Re: Updating emacs fails

2011-10-23 Thread Thomas Dickey
On Sun, Oct 23, 2011 at 11:23:36PM -, John Levine wrote:
> >ncurses is already in the base system - with different options. ...
> 
> >> Did you try installing the ncurses port and then rebuilding emacs? For 
> >> some reason the library in the ncurses port doesn't define the termcap 
> >> routines, leading to the problem.
> >
> >Whether or not the termcap routines are provided isn't configurable.
> >However, emacs could be confused since they're implemented on top
> >of terminfo.
> 
> It sounds to me like the right thing to do is to fix emacs' configuration
> so it always uses the base system ncurses whether or not the package
> version is there.  Right?

maybe/maybe not.  It depends on what emacs needs - whether it only works
with either its own termcap module or a conventional termcap library in
the system.  Probably its installation documentation tells what's needed.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpPtmhlvtCFe.pgp
Description: PGP signature


Re: Updating emacs fails

2011-10-23 Thread Thomas Dickey
On Sun, Oct 23, 2011 at 06:03:10PM +0200, John R. Levine wrote:
> >>>On 23/10/2011 09:03, John R. Levine wrote:
> >   checking for tparm in -lncurses... no
> >
> >but that's not correct.  libncurses should certainly contain that
> >symbol.  I get a 'yes' there on my stable/8 machine.  As -lncurses is
> >part of your LDFLAGS ... hmmm... do you have libncurses on your system
> >anywhere other than in /lib ?
> 
> I have the ncurses-5.9 package installed from ports.  Several gnome
> programs depend on it:
> 
> pkg_delete: package 'ncurses-5.9' is required by these other packages
> and may not be deinstalled:
> aalib-1.4.r5_6
> gnome-games-2.32.1_2
> guile-1.8.8
> libcdio-0.82_2
> libxine-1.1.19_7
> >>>
> >>>Interesting.  Can you try moving /usr/local/lib/libncurses.* and
> >>>/usr/local/include/ncurses.h aside temporarily and then rebuild emacs?
> >>>If that works, then looks like you've found a bug in the editors/emacs
> >>>port, which should be reported to the port's maintainer.
> >>
> >>Yup, that fixed it.  I'll file a bug report.  I tried rebuilding some
> >>of the packages that allegedly depend on the ncurses port, and they
> >>all seemed to work OK, so the right solution may be to deprecate the
> >>ncurses port or fold it into the mainline system.

ncurses is already in the base system - with different options.
See
http://invisible-island.net/ncurses/tctest.html
for example.

> >The way it's supposed to work is that emacs will depend on (and link to)
> >ncurses if it's installed when the emacs port is built, and to the base
> >system curses if not.  I just did a quick test, and this was just what
> >did happen.  So at least part of the problem is local to your system...
> 
> Did you try installing the ncurses port and then rebuilding emacs? For 
> some reason the library in the ncurses port doesn't define the termcap 
> routines, leading to the problem.

Whether or not the termcap routines are provided isn't configurable.
However, emacs could be confused since they're implemented on top
of terminfo.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpzC2ysp0ITv.pgp
Description: PGP signature


Re: OT: how to tell when i've hit a Fn key?

2011-10-06 Thread Thomas Dickey
On Thu, Oct 06, 2011 at 03:41:17PM -0700, Gary Kline wrote:
> 
> I've got a 103-key keyboard.  most  of them produce the right WAV
> file.  i was having some trouble with the arrow key, but think i've
> found a resolution.  next are the Function key, F1 to F12. 
> 
> anybody on-list familiar with curses and can help me  with this?
> right now, most of the function keys output 4 clicks [!].  

I generally use tack for verifying the function-keys against the terminal
description.  (I don't recall seeing a port for tack, but it can probably
be built starting with ncurses-devel, though I haven't tried that, since
I build development versions of ncurses outside the ports).

For _seeing_ the codes, it helps to type ^V (lnext) right before pressing
a given key, making the escape character visible.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpkRPxeLad9y.pgp
Description: PGP signature


Re: what are the plain GUI text editors that use the abbrev [as in vi]?

2011-10-02 Thread Thomas Dickey
On Sun, Oct 02, 2011 at 10:57:28AM -0700, Gary Kline wrote:
> On Sun, Oct 02, 2011 at 03:40:39AM -0700, Randal L. Schwartz wrote:
> > Date: Sun, 02 Oct 2011 03:40:39 -0700
> > From: "Randal L. Schwartz" 
> > Subject: Re: what are the plain GUI text editors that use the abbrev [as in
> >  vi]?
> > To: Gary Kline 
> > Cc: FreeBSD Mailing List 
> > 
> > > "Gary" == Gary Kline  writes:
> > 
> > Gary> several months ago i asked this list if there were any =easier= text
> > Gary> editors than vi[m] that had the abbrev ability.
> > 
> > GNU Emacs is easier for me than vim is.  And it has abbrev mode.
> 
> 
>   I'm looking for  a GUI editor that can be used by most
>   people with little training.  Somebody told me that one of
>   the GUI editors have the abbreviation feature.  
> 
>   [the only way i can use emacs is with xemacs and VILE!
>   back to vi.]

vile has abbreviate...

"abbreviate"
  or"show-abbreviations"
  ( establish shorthand for another string, or show all abbreviations )

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpQA09sEwZ7a.pgp
Description: PGP signature


Re: 'man' wrong show

2011-09-25 Thread Thomas Dickey
On Sun, Sep 25, 2011 at 02:19:22PM +0300, Êîíüêîâ Åâãåíèé wrote:
> Hi.
> 
> When I rum 'man' it show info like:
> 
> 1mNAME0m
>  1mhostapd 22m-- authenticator for IEEE 802.11 networks
> 
> 1mSYNOPSIS0m
>  1mhostapd 22m[1m-BdhKtv22m] [1m-P 4m22mpidfile24m] 4mconfig-file24m 
> 4m...0m
> 
> 1mDESCRIPTION0m
>  The 1mhostapd 22mutility is an authenticator for IEEE 802.11 networks.  
> It
> 
> can you help me, why it shows wrong?

man grotty claims that setting the GROFF_NO_SGR environment variable
fixes this (I've been using it ever since the misfeature was added
to groff).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp7XUrq8PaHx.pgp
Description: PGP signature


Re: Why selecting text with mouse often doesn't make the text pasteable with mouse mid-button click?

2011-09-18 Thread Thomas Dickey
On Sun, Sep 18, 2011 at 08:29:32PM +0100, Anton Shterenlikht wrote:
> On Sun, Sep 18, 2011 at 01:28:18PM -0400, Thomas Dickey wrote:
> > On Sun, Sep 18, 2011 at 09:06:44AM -0700, Yuri wrote:
> > > On 09/18/2011 06:05, Thomas Dickey wrote:
> > > >>>  I notice this again and again: when I select some text in Konsole 
> > > >>(KDE4)
> > > >>>  sometimes it doesn't paste with the middle mouse button click.
> > > >Where are you pasting?  (on another terminal emulator, in an application
> > > >running in a terminal emulator, or within another X application)?
> > > >
> > > 
> > > Test selected in Konsole I usually paste into Konsole. and it fails 
> > > maybe in 5-10% of cases.
> > 
> > hmm - no good guesses there.  It could be an overactive Window manager
> > grabbing the focus away at the wrong point (it's a nuisance on Mac OS X
> > for instance).  If it were a consistent problem with pasting into a
> > given application, I had a couple of ideas...
> > 
> > (consistent problems are easier to fix ;-)
> 
> Now you mentioned it, I see something similar.
> I typically paste from one xterm window to another.
> Typically one xterm is the local box and another
> xterm is some ssh session.

this part could be xterm, but more likely is in the X server.

An xterm-specific problem tends to be pretty reproducible, since it'll
depend on what the source/destination are.  (The ones that aren't are
related to timing and repainting - things like that).
 
> What I see on amd64 laptop is that pasting with a built-in
> mouse stops working after a while. I typically have
> a usb mouse as well. Pasting with a usb mouse never fails.
> 
> I can copy with a built-in mouse and paste with a usb mouse.
> Because in the end I get done what I need, I never
> really bothered to think why.
> 
> Next time this happens, I'll try to record the
> exact details, if you are interested.

hmm - I'm not sure I can use the information effectively.  Right now I'm setup
with a KVM using USB for a Mac OS X server, with a laptop running Xen Server
(which gets its mouse via the X connection).  Both of those run VM's, which is
where I do most of my work...  (the hardware stays stable for quite a while).

The KVM's used to occasionally access a desktop.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpmHMknGbCM6.pgp
Description: PGP signature


Re: Why selecting text with mouse often doesn't make the text pasteable with mouse mid-button click?

2011-09-18 Thread Thomas Dickey
On Sun, Sep 18, 2011 at 09:06:44AM -0700, Yuri wrote:
> On 09/18/2011 06:05, Thomas Dickey wrote:
> >>>  I notice this again and again: when I select some text in Konsole 
> >>(KDE4)
> >>>  sometimes it doesn't paste with the middle mouse button click.
> >Where are you pasting?  (on another terminal emulator, in an application
> >running in a terminal emulator, or within another X application)?
> >
> 
> Test selected in Konsole I usually paste into Konsole. and it fails 
> maybe in 5-10% of cases.

hmm - no good guesses there.  It could be an overactive Window manager
grabbing the focus away at the wrong point (it's a nuisance on Mac OS X
for instance).  If it were a consistent problem with pasting into a
given application, I had a couple of ideas...

(consistent problems are easier to fix ;-)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpKCWK8s6nnQ.pgp
Description: PGP signature


Re: Why selecting text with mouse often doesn't make the text pasteable with mouse mid-button click?

2011-09-18 Thread Thomas Dickey
On Sat, Sep 17, 2011 at 06:21:56PM -0700, Yuri wrote:
> I notice this again and again: when I select some text in Konsole (KDE4) 
> sometimes it doesn't paste with the middle mouse button click.

Where are you pasting?  (on another terminal emulator, in an application
running in a terminal emulator, or within another X application)?

> I also notice the same in chrome, and it's even more likely there.
> 
> Why such basic feature fails intermittently?
> 
> 8.2-STABLE amd64
> 
> Yuri

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpva42YLvFCR.pgp
Description: PGP signature


Re: [UPDATE] host-setup(1): a dialog(1)-based utility for configuring FreeBSD

2011-04-23 Thread Thomas Dickey
On Sat, Apr 23, 2011 at 08:54:51AM +0100, Bruce Cran wrote:
> On Fri, 22 Apr 2011 09:52:44 -0700
> "Devin Teske"  wrote:
> 
> > Looks like `--hline' is not supported anymore. Thinking this should
> > either be patched or documented in ERRATA/UPGRADING.
> 
> I think you mean UPDATING :)

perhaps.  But reporting bugs is nicer than long discussion threads.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpOn35W99yEd.pgp
Description: PGP signature


Re: new termcap entry for rxvt-unicode-256color

2010-12-13 Thread Thomas Dickey
On Mon, Dec 13, 2010 at 08:11:47AM -0800, Chip Camden wrote:
> Quoth Frédéric Perrin on Monday, 13 December 2010:
> > Hello,
> > 
> > rxvt-unicode version 9.09 was released last month. It added support for
> > 256 colors in the default configuration, and the default value of $TERM
> > changed to rxvt-unicode-256color (from rxvt-unicode).
> > 
> > This results in slightly incorrect colors, and some programs like vi(1)
> > refuse to work. It is my understanding that I should update
> > /usr/share/misc/termcap. The diff between rxvt-unicode and
> > rxvt-unicode-256color seems rather short; on a Linux machine, I have :
> > 
> > girafe:~% infocmp -d rxvt-unicode rxvt-unicode-256color
> > comparing rxvt-unicode to rxvt-unicode-256color.
> > comparing booleans.
> > comparing numbers.
> > colors: 88, 256.
> > pairs: 7744, 32767.
> > comparing strings.
> > 
> > However, I don't how how to update the termcap file. From my
> > understanding of the manpage, the following command should give me the
> > necessary information :
> > 
> > girafe:~% infocmp -C -u rxvt-unicode-256color rxvt-unicode
> > rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window 
> > System):\
> > :tc=rxvt-unicode:
> > 
> > As you see, their is no mention of the 256-color capabilities, this
> > doesn't seem correct. How do I update the termcap file ?

The 256-colors aren't shown since the corresponding terminfo expression
doesn't map to termcap.  (I added a workaround recently in ncurses to
recognize this special case).  For example

xterm+256color|xterm 256-color feature:\
:cc:\
:Co#256:pa#32767:\
:AB=\E[48;5;%dm:AF=\E[38;5;%dm:Sb@:Sf@:

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpQrkV3zYlkR.pgp
Description: PGP signature


Re: Grepping a list of words

2010-08-12 Thread Thomas Dickey
On Wed, Aug 11, 2010 at 06:00:22PM -0500, Jack L. Stone wrote:
> Kindly appreciate help with how to grep (or similar) a list of words to
> determine if any of them are in a file rather than grepping one word at a
> time.

put the list in a file, and use grep -f

better, use the \< and \> markers on the file's contents and use egrep.

(grep -w option is likely to be buggy when available).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpxMjjuiLfE9.pgp
Description: PGP signature


Re: Good Terminal for X?

2010-08-08 Thread Thomas Dickey
On Sat, Aug 07, 2010 at 06:41:11PM -0600, Chad Perrin wrote:
> On Fri, Aug 06, 2010 at 04:12:47PM -0400, Thomas Dickey wrote:
> > On Fri, Aug 06, 2010 at 11:26:10AM +0200, Roland Smith wrote:
> > > 
> > > Try x11/rxvt-unicode. It doesn't require Gnome nor KDE libraries, and it 
> > > does
> > > handle unicode well. It's a lot lighter than xterm. And it has 
> > > transparancy or
> > > backgrounds if you like that.
> > 
> > It's not "a lot lighter" - I made a table recently to investigate.
> > See
> > 
> > http://invisible-island.net/xterm/xterm.faq.html#bug_rxvt
> 
> Thanks for the research.  I had no idea rxvt-unicode had gotten so big.

The base size has certainly increased well beyond the original rxvt.
The total size seems to be from the transparency support.

One thing that surprised me in collecting the data was noting the
terminals which are mostly implemented as libraries.  Their main
programs can be quite small.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgppysGjK6He4.pgp
Description: PGP signature


Re: Good Terminal for X?

2010-08-06 Thread Thomas Dickey
On Fri, Aug 06, 2010 at 11:26:10AM +0200, Roland Smith wrote:
> On Fri, Aug 06, 2010 at 03:12:11AM -0500, Depo Catcher wrote:
> > 
> > I use Icewm, so don't want to install all that kde/gnome 
> > libs/dependencies and such to get konsole or gnome-console (but both are 
> > nice)
> > 
> > xterm does display some things correctly (like sysinstall type command 
> > line GUIs).
> 
> Try x11/rxvt-unicode. It doesn't require Gnome nor KDE libraries, and it does
> handle unicode well. It's a lot lighter than xterm. And it has transparancy or
> backgrounds if you like that.

It's not "a lot lighter" - I made a table recently to investigate.
See

http://invisible-island.net/xterm/xterm.faq.html#bug_rxvt

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp409dJkYrHu.pgp
Description: PGP signature


Re: ncurses

2010-06-05 Thread Thomas Dickey
On Sat, Jun 05, 2010 at 10:13:34AM -0700, Chip Camden wrote:
...
> Thanks for your response, but I solved the problem by specifying that
> mutt should use slang instead of ncurses.  That works better in a couple
> of ways, so I'll go with that.
> 
> I do, however, still have one small problem.  I can't seem to get mutt to
> see that my urxvt has 256 colors enabled.  infocmp shows "colors#256" for
> rxvt-256color, but if I do 'export TERM=rxvt-256color' then zsh complains
> "can't find terminal definition for rxvt-256color" (though it lets me set
> it anyway).  However, mutt still complains if I try to use any color
> above 8.  With TERM set to "rxvt" infocmp shows "colors#8" and tput
> colors shows "145".  I'm confused.  Obviously, not everyone is on the
> same page here.

There is more than one potential problem - here're a few:

ncurses' default configuration doesn't support 256 colors ("only" 16,
which was more than the standard 15 years ago).  It supports 256 colors
as a binary-incompatible extension of ncursesw, which could be provided
in a port.  With/without the extension, infocmp would show the 256.

zsh may be looking in the termcap interface, which iirc on FreeBSD is
using a separate database.

FreeBSD may still be using a tput that's not based on ncurses.
"145" is puzzling here, too.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpdaow7em1bv.pgp
Description: PGP signature


Re: how to force end-of-line in man page source

2010-05-11 Thread Thomas Dickey
On Tue, May 11, 2010 at 01:36:20PM +0800, Fbsd1 wrote:
> I don't like the way some lines in the man page have the last word in 
> the sentence broken in 2 and hyphenated. Is there some escape code I can 
> put at the end of the line in the source code to suppress this?

You can generally override the hyphenation mode with

.hy 0

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpwsLwUovkwE.pgp
Description: PGP signature


Re: Compose key and xterm vs. UTF-8

2010-03-14 Thread Thomas Dickey
On Sun, Mar 14, 2010 at 12:45:24PM +0100, Roland Smith wrote:
> On Sun, Mar 14, 2010 at 12:16:45AM +, Christian Weisgerber wrote:
> > Short:
> > --
> > Why do compose key sequences fail to work in a UTF-8 xterm?
> 
> The port x11/rxvt-unicode is lighter on resources then xterm, and works fine
> with utf-8. (with LANG=en_US.UTF-8 and LC_ALL=en_US.UTF-8 set)

That doesn't appear to answer his question.

awai

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpkGv4Pzen2O.pgp
Description: PGP signature


Re: backup terminal title

2010-02-07 Thread Thomas Dickey
On Sun, Feb 07, 2010 at 09:49:54AM +0100, Dominic Fandrey wrote:
> I finally got it:
> 
> printf "\033[22;0t"
>   This stores the current icon and window titles on a stack.
> printf "\033[23;0t"
>   This restores them from the stack.
> 
> It works fine with xterm, has no effect on rxvt-unicode (which I
> am using), though.

I wouldn't expect it to work with the other terminals - it takes usually
a year or more before features from xterm get copied into other programs.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpxj4XVJjr07.pgp
Description: PGP signature


Re: backup terminal title

2010-02-07 Thread Thomas Dickey
On Sun, Feb 07, 2010 at 09:49:54AM +0100, Dominic Fandrey wrote:
> I finally got it:
> 
> printf "\033[22;0t"
>   This stores the current icon and window titles on a stack.
> printf "\033[23;0t"
>   This restores them from the stack.
> 
> It works fine with xterm, has no effect on rxvt-unicode (which I
> am using), though.

I wouldn't expect it to work with the other terminals - it takes usually
a year or more before features from xterm get copied into other programs.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp9O40FX1T1V.pgp
Description: PGP signature


Re: backup terminal title

2010-02-07 Thread Thomas Dickey
On Sat, Feb 06, 2010 at 10:04:49PM -0800, per...@pluto.rain.com wrote:
> Warren Block  wrote:
> > What's the sequence for reading the terminal title?
> 
> If I remembered it I'd have included it :)
> 
> The first 3 results from Googling "xterm escape sequences" are

This is where to start (the other ones are older versions):

http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

By the way, it's the first hit when I ask google the same question.

>   rtfm.etla.org/xterm/ctlseq.html
> 
>   www.faqs.org/docs/Linux-mini/Xterm-Title.html
> 
>   www.kitebird.com/csh-tcsh-book/ctlseqs.pdf
> 
> I'd expect it to be in at least one of them.

That's a nice assumption.  However...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp34PRPxLogu.pgp
Description: PGP signature


Re: backup terminal title

2010-02-06 Thread Thomas Dickey
On Sat, Feb 06, 2010 at 01:55:55PM +0100, Matthias Apitz wrote:
> El día Saturday, February 06, 2010 a las 01:38:11PM +0100, Dominic Fandrey 
> escribió:
> 
> > I just started to wonder how portmaster changes the window title
> > of my terminal and why it doesn't change it back when it
> > terminates.
> > 
> > Some digging in the portmaster code showed up an escape sequence:
> > printf "\033]0;%s\007" "YOUR TEXT GOES HERE"
> > 
> > Unfortunately I am entirely clueless as to how one could backup
> > the old title string to restore it upon termination. It seems
> > to me this ought to be a precondition to using this kind of
> > feature.
> 
> Play around with xwininfo(1), like:
> 
> $ xwininfo -tree -root | fgrep xterm
> 
> which prints the titles for all your XTerm windows.

iirc, vim does something like this, but it has the potential for being
very slow (ymmv).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgprUhQe4zlss.pgp
Description: PGP signature


Re: backup terminal title

2010-02-06 Thread Thomas Dickey
On Sat, Feb 06, 2010 at 01:38:11PM +0100, Dominic Fandrey wrote:
> I just started to wonder how portmaster changes the window title
> of my terminal and why it doesn't change it back when it
> terminates.
> 
> Some digging in the portmaster code showed up an escape sequence:
> printf "\033]0;%s\007" "YOUR TEXT GOES HERE"
> 
> Unfortunately I am entirely clueless as to how one could backup
> the old title string to restore it upon termination. It seems
> to me this ought to be a precondition to using this kind of
> feature.

It "can", depending - some people object to the control sequence which
can retrieve the previous value.  I added a push/pop stack for xterm last
year which can work around that (transparently).  I used that in vile
(vi like emacs), and I made a fix for 'screen' which uses it.

see
http://invisible-island.net/xterm/xterm.log.html#xterm_251

For other terminals - some have disabled the objectionable feature,
some have not.  (Some will eventually copy the push/pop feature ;-)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpdNZr7YsZSr.pgp
Description: PGP signature


Re: sysinstall and the Right Terminal

2010-01-25 Thread Thomas Dickey
On Mon, Jan 25, 2010 at 09:25:21AM -0600, Martin McCormick wrote:
> Thomas Dickey writes:
> > "Terminal" would probably be one of the programs using VTE,
> > which differs from "linux".
> 
>   This is all very interesting. Thanks to all. What I
> normally do is start a command-line shell on a Debian Linux box.
> This defaults to a "linux" console. When I ssh somewhere, ssh
> passes the exported $TERM value to the remote host so as I
> understand it, it will use this value in the environment that it
> exports to any application called from that shell. The question
> is whether or not all the escape codes it sends to address the
> terminal and all the escape sequences it looks for to represent
> arrow keys, etc, will still work. 

It should - the remote machine "should" have the same terminal description.

Your local machine however may have initialized the Linux console to expect
UTF-8 encoding, and the remote machine may not know about that.  Line-
drawing wouldn't work properly in that case, but cursor-movement and
keys should.
 
>   The best results, so far, are with using cons25 as the
> TERM value. The Up and Down arrows work right as opposed to going
> right straight to X Exit this menu.

My first impression was that it could be a disagreement between the two
machine whether cursor-application mode is set.  That changes the escape
sequence sent by the cursor-keys.

However, ncurses' descriptions for both say they're using
normal (non-application) mode.  So that doesn't seem to explain it.

It's also possible that the screensize isn't being transmitted (and
"stty -a" would show if it's really 25 lines or not).

> 
>   I appreciate all the input because in this game,
> knowledge is the power to fix it.
> 
> Martin McCormick
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpQLAAPrLnah.pgp
Description: PGP signature


Re: sysinstall and the Right Terminal

2010-01-23 Thread Thomas Dickey
On Sat, Jan 23, 2010 at 08:01:41AM -0600, Martin McCormick wrote:
> Dale Scott writes:
> > I don't have a solution but can report I regularily login to my fbsd 7 
> > and 8 boxes from an Ubuntu laptop using ssh in
> > Terminal and run sysinstall. I've never encountered this problem though.
> 
> Thank you for responding.
> 
> If you type
> 
> echo $TERM 
> 
> or just the command 
> 
> env
> 
> Is TERM = "linux" or something else?

"Terminal" would probably be one of the programs using VTE,
which differs from "linux".

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgplbt0hD0XM4.pgp
Description: PGP signature


Re: example c program that does "beep"

2009-12-26 Thread Thomas Dickey
On Sat, Dec 26, 2009 at 05:16:23PM +, Anton Shterenlikht wrote:
> On Sat, Dec 26, 2009 at 11:50:06AM -0500, Thomas Dickey wrote:
> > 
> > instead of the printf/fflush, it would clear the screen and beep - if the
> > terminal description says it can do the beep.
> 
> I have 
> 
> > echo $TERM
> xterm
> >
> 
> xterm can do beep, can't it?

usually.  I broke it (and fixed it) last spring.
There's a workaround by setting a resource value, noted in the change
comment:

http://invisible-island.net/xterm/xterm.log.html#xterm_243

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpNznqBird5K.pgp
Description: PGP signature


Re: example c program that does "beep"

2009-12-26 Thread Thomas Dickey
On Sat, Dec 26, 2009 at 03:33:27PM +, Anton Shterenlikht wrote:
> On Fri, Dec 25, 2009 at 08:49:14PM +0100, Polytropon wrote:
> > On Fri, 25 Dec 2009 18:58:26 +, Anton Shterenlikht 
> >  wrote:
> > > How can I get a beep from c?
> > > I looked at curses and syscons.c, but
> > > still not clear.
> > 
> > If you want to use NCURSES / CURSES, it's a bit complicated.
> > 
> > Otherwise, just output %c (the character) 0x07, BEL, which
> > generates an audible bell, or beep.
> > 
> > 
> > *** text/plain attachement has been stripped *** RETRY ***
> > 
> > /* beepflash.c
> >  * ---
> >  * cc -Wall -lcurses -o beepflash beepflash.c
> >  *
> >  */
> > 
> > #include 
> > #include 
> > 
> > int main(int argc, char *argv[])
> > {
> > initscr();
> > cbreak();
> > noecho();
> > nonl();
> > intrflush(stdscr, FALSE);
> > keypad(stdscr, TRUE);
> > start_color();
> > 
> > printf("beep: %d\n", beep());
> > fflush(stdout);
> > 
> > printf("flash: %d\n", flash());
> > fflush(stdout);
> > 
> > return 0;
> > }
> 
> Instead of a beep and a flash I get:
> 
> beep: 0./beepflash
>flash: 0
>HAMOR>

That sounds about right, given the code shown above.
If you'd used just
beep();
refresh();

instead of the printf/fflush, it would clear the screen and beep - if the
terminal description says it can do the beep.

In the ncurses sources, progs/clear.c is a simple program which sets
up the terminal and calls the tputs function - something like what you're
trying to do.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpJ5yl6kbLCZ.pgp
Description: PGP signature


Re: example c program that does "beep"

2009-12-25 Thread Thomas Dickey
On Fri, Dec 25, 2009 at 08:34:39PM +0100, Polytropon wrote:
> On Fri, 25 Dec 2009 18:58:26 +, Anton Shterenlikht  
> wrote:
> > How can I get a beep from c?
> > I looked at curses and syscons.c, but
> > still not clear.
> 
> If you want to use NCURSES / CURSES, it's a bit complicated.

tput bel

(that's part of ncurses - though your configuration iirc doesn't have
a fully-functional tput).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpxYrymOFAfs.pgp
Description: PGP signature


Re: .Xdefaults file

2009-12-23 Thread Thomas Dickey
On Tue, Dec 22, 2009 at 10:10:26PM +, Jamie Griffin wrote:
> On Tue, Dec 22, 2009 at 01:45:52PM -0800, Rem P Roberti wrote:
> 
> > > I think case matters here, i.e. XTerm*, not Xterm or xterm.
>  
> > Exactly the problem.  Thank you!
> 
> Curious, on my system (7.2) my ~/.Xdefaults uses lowercase 'xterm*...'
> values.

That would be the application name (the name by which xterm is invoked),
which also is legal - for the top-level.  It's all in the X manpage...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpLL3ezp5fjV.pgp
Description: PGP signature


Re: Setting fonts and other defaults in Xorg--new q? on font menu

2009-12-22 Thread Thomas Dickey
On Tue, Dec 22, 2009 at 02:48:15AM -0800, Mark Terribile wrote:
> >  After finding what you like simply add the lines to ~/.Xdefaults:
> > 
> > XTerm*faceName: Liberation Mono
> > XTerm*faceSize: 10
> 
> Is there a way to change the contents of the xterm font menu without editing
> the xterm source?  If so, how to do it?

Modifying your resource definitions doesn't affect the xterm source...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgptAy6xsaKMf.pgp
Description: PGP signature


Re: terminal setup issues on FreeBSD

2009-10-22 Thread Thomas Dickey
On Thu, Oct 22, 2009 at 05:22:42PM -0400, Lowell Gilbert wrote:
> Try setting the terminal type to "screen" or "vt100" (which is what
> screen claims to emulate, although it understands even more extensions
> than xterm).  Better yet, don't set it *at all* and let ssh carry the
> environment value through from the other side.

hmm - no (screen's escape sequences generally are a subset of xterm -
I can recall large chunks missing, and at the moment don't see any
significant counter-examples - it _does_ have a handful of rarely-used
termcap capabilities that you may be referring to ;-).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp3Umbgx4rV4.pgp
Description: PGP signature


Re: Date representation as YY/DDD or YYYY/DDD

2009-06-05 Thread Thomas Dickey
On Fri, Jun 05, 2009 at 10:11:00PM +0100, Chris Rees wrote:
> 
> The point I was trying to make (badly), was that long options are a
> PITA to type. I don't believe it's any easier to learn the long names
> for options than the short ones. Since you're typing huge amounts of
> text quickly, you're more likely to make mistakes, and you'll probably
> forget them anyway.

One can have long options in a user-friendly way (some implementors choose
to allow them to be abbreviated; some environments do name-completion).

As I'm editing this remark, for example, I'm using a text editor that
does name-completion (a good thing since it has several hundred commands,
which can each be bound to a single character, etc).
 
-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpaYBJpO4PDX.pgp
Description: PGP signature


Re: Date representation as YY/DDD or YYYY/DDD

2009-06-05 Thread Thomas Dickey
On Fri, Jun 05, 2009 at 10:49:19PM +0200, Wojciech Puchar wrote:
> >GNU recommended:
> >
> >$ tar --extract --verbose --gunzip --file bluurgh.tgz
> >
> >Seriously, why are long options encouraged?
> >
> there are people that like to write a lot? ;)

no..., otherwise the people generating this thread would cite realistic
examples, rather than writing a lot.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Date representation as YY/DDD or YYYY/DDD

2009-06-05 Thread Thomas Dickey
On Fri, Jun 05, 2009 at 09:23:06PM +0100, Chris Rees wrote:
> Seriously, why are long options encouraged?

Some programs simply have a lot of options, and after a dozen or
so, a single letter loses its mnemonic value.

X applications have been using long options for 20 years - long enough
to get used to the notion.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Open_Source

2009-06-05 Thread Thomas Dickey
On Fri, Jun 05, 2009 at 11:46:21AM -0600, Chad Perrin wrote:
> The links browser's interface is crap, as is that of every other text
> console based browser I've ever encountered.  Moving around within a
> page and selecting a link are two tasks for which text console based
> browsers have not provided an even halfway decent interface.  It seems as
> though Web browsers provide a rare case of an application type that is
> specifically suited primarily for a mouse-driven interface.

lynx, (e)links(2) and w3m all support a mouse...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: changing tab stops

2009-05-31 Thread Thomas Dickey
On Sun, May 31, 2009 at 03:44:24PM -0400, Robert Huff wrote:
> 
>   I have a C program that writes to a terminal (currently xterm,
> but could be anything).  For reasons I won't go into, I would like
> to read and change the terminal's tab stops ... from within the
> program ... in a generic/portable way.

You could make a program which does what "resize" does to find the
screensize: it moves the cursor and asks where it is.  (I'm not
aware of an existing program which asks based on tab stops).

>   Is this possible?
>   If so, what are the keywords associated with my first clue?

The control sequence that does the asking is the cursor position
report (CPR).

http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

(also vt100.net).

Not all terminals implement this (for instance FreeBSD console probably
does not).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp17rTVu32wR.pgp
Description: PGP signature


Re: backspace-key and ^H when ssh -X remote.

2009-05-23 Thread Thomas Dickey
On Sat, May 23, 2009 at 03:03:00PM +0200, Polytropon wrote:
> On Sat, 23 May 2009 06:35:56 -0400, Thomas Dickey  wrote:
> > probably (outside of Linux and a few special cases such as Cygwin,
> > "everyone" else uses ^H for backspace - all of the BSD's and all
> > of the vendor Unix's).
> 
> As far as I know, ^? indicates the delete key... Maybe the
> delete key does ^H in this setting?

By "uses ^H for backspace", I was referring to the terminal emulators
such as xterm which can be initialized to send either ^H or ^? for
the "backspace" key, as well as the console terminals which generally
send one or the other...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpKRZb50F0PD.pgp
Description: PGP signature


Re: backspace-key and ^H when ssh -X remote.

2009-05-23 Thread Thomas Dickey
On Fri, May 22, 2009 at 11:04:05PM -0700, Gary Kline wrote:
> guys,
> 
> here's a bug with how the backspace key doesn't work across computers.
> i'm not sure if there were troubles going from FBSD to FBSD, but there is
> when i ssh from my ubuntu platform to my main desktop.  i do this to edit
> files or for replying to mutt mail using vi.
> 
> going from ethos [ubuntu] to tao [fbsd] and using vi, the backspace key
> is translated to \177 and is echoed as "^?".  it does not erase.  i have
> to type 
> 
> % stty erase ^V [backspacekey]
> 
> to fix this problem. otherwise, to erase a character, i have to type a
> control-H. it is exact the same problem going from fbsd to ubunto. 
> has anybody seen this before?

probably (outside of Linux and a few special cases such as Cygwin,
"everyone" else uses ^H for backspace - all of the BSD's and all
of the vendor Unix's).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpp0vuivOg8X.pgp
Description: PGP signature


Re: UTF-8 file + console

2009-03-31 Thread Thomas Dickey
On Tue, Mar 31, 2009 at 12:15:33PM +0200, Paul B. Mahol wrote:
> On 3/31/09, Thomas Dickey  wrote:
> > On Tue, Mar 31, 2009 at 11:36:32AM +0200, Paul B. Mahol wrote:
> >> On 3/31/09, Arek Czereszewski  wrote:
> >> > I have php application in UTF-8 on server
> >> > (in files are 4 languages: PL, SK, CZ and EN).
...
> > That might be a configuration issue rather than the program.
> > ("EN" in particular ;-)
> 
> Generally speaking FreeBSD console doesnt support UTF-8. So even if
> program (in this case vim) supports UTF-8 it will not work.

There's two parts: does the editor knows how to manipulate UTF-8,
and does the terminal display UTF-8.  If the editor knows that the
terminal doesn't display UTF-8, it can choose a representation that
works for the terminal (even if it happens to be FreeBSD's console).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpQfDBDBE3Pg.pgp
Description: PGP signature


Re: UTF-8 file + console

2009-03-31 Thread Thomas Dickey
On Tue, Mar 31, 2009 at 11:36:32AM +0200, Paul B. Mahol wrote:
> On 3/31/09, Arek Czereszewski  wrote:
> > Hi,
> >
> > I have php application in UTF-8 on server
> > (in files are 4 languages: PL, SK, CZ and EN).
> >
> > Is there any chance to edit this files on console?
> > Or should I edit files in Linux/Mac/Win editor with
> > UTF support and upload then to server?
> 
> You can edit them inside vim, but they will not be
> displayed correctly.

That might be a configuration issue rather than the program.
("EN" in particular ;-)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpvrihzKDCC6.pgp
Description: PGP signature


Re: Emacs doesn't want to support 256 colors in terminal window

2009-02-28 Thread Thomas Dickey
On Sat, Feb 28, 2009 at 02:21:05AM +, Grzegorz Junka wrote:
> colors on the Windows terminal. For that I reconfigured putty/rxvt to 
> report the (logical) terminal type as xterm-256color. That didn't work 

ncurses has an rxvt-256color entry...

> so I tried to redefine the TERM environment variable on my account, but 
> that didn't work either. The problem seems to be with the Co value 
> defined for the xterm terminal type, because 'tput Co' shows 8 instead 
> of 256 for all physical/logical terminal configurations. I hope now it 
> is clear what I am running where.

tput is only going to show what's in the terminal database.
For "xterm", that's normally 8 colors, unless someone's modified it.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpR9dqUdikNa.pgp
Description: PGP signature


Re: xorg 7.4: "button" fonts unreadable ...

2009-02-09 Thread Thomas Dickey
On Mon, Feb 09, 2009 at 08:58:12PM -0400, Marc G. Fournier wrote:
> 
> So, if I backtrack to 7.3.x, I should be fine?

that sounds like it (I don't keep track of the version numbers).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpIAaiseBBGi.pgp
Description: PGP signature


Re: xorg 7.4: "button" fonts unreadable ...

2009-02-09 Thread Thomas Dickey
On Mon, Feb 09, 2009 at 07:28:58PM -0400, Marc G. Fournier wrote:
> 
> Have searched Google, but haven't been able to find anything that either 
> worked, or was relevant ... I just cleaned out and reinstalled all of my 
> ports ... when I load up an xterm (the one I'm working in right now), all 
> the text in it is fine and readable ... but, the top of the xterm, where 
> it has the 'xterm icon' and some writing to the right of it, the writing 
> is unreadable ...

Basically, the xorg hackers decided to improve your user experience by
lobotomizing the fonts - I modified xterm to recover from that by falling
back to "fixed" (I'm unsure why they left that intact).

However, window titles are owned by your window manager.
 
> If I load up firefox3, the web pages are viewable and readable, but stuff 
> like the location bar are unreadable (I have to hope I type without making 
> a mistake) ...
> 
> I'm not sure what to look at ... have checked the output from starting X, 
> and not seeing anything font related ...

Best advice is to locate the "misc" fonts (or whatever it's called in
FreeBSD) and install those.  That'll work until the next improvement to
the X server's font handling.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpMvHElJM74r.pgp
Description: PGP signature


Re: printf and utf-8

2009-01-27 Thread Thomas Dickey
On Mon, Jan 26, 2009 at 03:03:44PM -0800, Chuck Swiger wrote:
> On Jan 26, 2009, at 3:05 PM, Svein Halvor Halvorsen wrote:
> >Do you have a suggestion to solve the following problem without  
> >using printf(1):
> >
> >I have a text file that I want to print in a "box" on a terminal  
> >from a shell script. Now I've padded the lines with spaces to a  
> >certain length using printf %-70s and appended the box drawing  
> >character. Is there another simple way that will work with utf-8?
> 
> My first thought was about dialog(1), but I'm not sure whether that  
> deals with UTF8 any better...?

There's dialog(1) in the FreeBSD tree, and dialog(1) on my website.
The latter can work with UTF-8 (if it's built with ncursesw).
But that's a little different from printf...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpQnR3vgPxNo.pgp
Description: PGP signature


Re: dialog run away processes

2008-12-12 Thread Thomas Dickey
On Thu, Dec 11, 2008 at 02:35:43PM -0800, Noah wrote:
> Hi there,
> 
> sometimes I find there one or two processes with the command name of 
> 'dialog' tacking the cpu on my freebsd machines.  any clues what creates 
> this situation and how I can circumvent the problem?  It appears to 
> happen around the time I run portmanager to update all the system ports.

dialog is interactive.  Sometimes it's possible to start dialog (or
other interactive process) and disconnect the terminal input.  Then
(depending on how errors are handled), it tries repeatedly to read
input.

(that's addressed in the version of dialog which I maintain, but FreeBSD
has, iirc, a variant from long ago which isn't strictly compatible).

http://invisible-island.net/dialog/

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpiwAXoYEr69.pgp
Description: PGP signature


Re: Sysinstall colors

2008-10-13 Thread Thomas Dickey
On Mon, Oct 13, 2008 at 02:09:29PM -0700, Jeremy Chadwick wrote:
> On Mon, Oct 13, 2008 at 09:42:04PM +0200, [EMAIL PROTECTED] wrote:
> > After some trial and error, I put
> >
> > XTerm*color7:  #bebebe
> >
> > in my .Xdefaults. Now the yellow sysinstall font is much more legible  
> > inside an xterm. This works for both xterm and rxvt. The rxvt man page  
> > proved very useful.
> >
> > Now I have solved my problem but other users may experience the same  
> > problem. Is it possible to modify sysinstall so that it uses a darker  
> > background gray when run inside xterm?
> 
> I'm not sure this is desirable or recommendable.  There are some
> terminal emulation programs -- specifically, PuTTY -- which emulate
> TERM=xterm.  The RGB colours in PuTTY look just fine: quite legible.

more/less (putty's wrapping behavior differs)

> The key problem here is this: there are no more darker grey backgrounds
> available with the limited colour set available.  You get one grey bg --
> sequence \e[47m; -- and that's it.  If you want other colours, you have
> to have a 256-colour xterm compiled, which supports an extended palette,
> and there's no way to detect if someone has such a capable terminal
> (basing it on $TERM is not correct).

actually, basing it on $TERM is the way most people would do it,
e.g.,

xterm-256color|xterm with 256 colors,
am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
colors#256, cols#80, it#8, lines#24,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
...

initc=\E]4;%p1%d;rgb:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpRZ8Ss8K1RJ.pgp
Description: PGP signature


Re: curses.h, beep() returns ERR, flash() casuses segment fault.

2008-08-28 Thread Thomas Dickey
On Wed, Aug 27, 2008 at 07:10:40PM -0700, Christopher Joyner wrote:
> I do not get the OK from beep, and flash crashes the program.
> This is my code:
> 
> #include 
> 
> int main(int argc,char** argv)
> {

  initscr();/* see also filter() and newterm() */

> if(beep()!=OK)

//> printf("No OK\n"); fflush(stdout);
printw("No OK\n");

> if(flash()!=OK)

//> printf("No Flash\n"); fflush(stdout);
printw("No Flash\n");
  getch();
  endwin();

> return 0;
> }

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpFLzadHJUGi.pgp
Description: PGP signature


Re: space char shell script problem

2008-08-23 Thread Thomas Dickey
On Sat, Aug 23, 2008 at 04:09:57PM +0200, Polytropon wrote:
> On Sat, 23 Aug 2008 06:19:42 -0400, David Banning <[EMAIL PROTECTED]> wrote:
> > I am running into a problem with the space character in filenames.
> > For instance, If I want to run the script;
> > 
> > for x in `ls`
> > do
> >   echo $x
> > done
> > 
> > then filenames that have a space in them ie: "john smith.jpg"
> > are processed by my script as two names, "john" and "smith.jpg".
> > 
> > What is the best way to deal with this type of space problem in the shell?
> 
> The best way is not to use spaces in filenames; underscores perform
> their purpose very well without making things more complicated. :-)

spaces won't go away, and since they're legal in filenames, one may as
well handle them.
 
> To iterate over files, I would not use `ls`, instead, I would let
> the shell do the expansion of * for me, as it has already been
> suggested.
> 
> Because the file names x iterates contain spaces, be very (!) careful
> to assure that the applications you call with these filenames get
> the spaces correctly masked, either put the filename in quotes or
> substituts " " by "\ ". You would have won nothing when the application
> you call with the filename interpretes it as an argument list with
> two elements.

A script like

#!/bin/sh
for x in "$@"
do
echo $x
done

handles quoting nicely enough (for spaces, anyway).  ls will translate
some non-printing characters to printable; the 'find' program is a better
alternative if one must derive the list inside the program.
 
> for x in *; do
>   echo "${x}"
> done
> 
> Replace the middle line with any program call you want.
> 
> 
> -- 
> Polytropon
> >From Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Closing the terminal results in closing of application started by the terminal even if the processes is backgrounded

2008-08-23 Thread Thomas Dickey
On Sat, Aug 23, 2008 at 01:36:32PM +0530, Siju George wrote:
> I started Firefox from an xterm.
> Then I pressed  +Z
> And the I typed bg to background Firefox process.
> But when I close xterm firefox also closes.

firefox still gets a SIGHUP since its controlling terminal is that xterm.
(if it's suspended, that doesn't appear to change anything).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Switch to alternate screen buffer

2008-07-26 Thread Thomas Dickey
On Sat, Jul 26, 2008 at 03:03:57PM +0200, Bertram Scharpf wrote:
> Hi,
> 
> Am Donnerstag, 24. Jul 2008, 16:57:40 +0200 schrieb Wojciech Puchar:
> >> I know from some old Linux installations that Less and Vim are able to
> >> switch to an alternate screen buffer. They use the escape sequences
> >> "\e[?1047h" and "\e[?1047l" to switch back respectively.
> >>
> >> How can I activate this in FreeBSD?
> >
> > no idea but do
> >
> > someprg 2>&1|vim -
> 
> No. I will not waive. This is not Microsoft here.
> 
> Edit /usr/share/misc/termcap. Change the following entry:
> 
>   xterm|xterm-color|X11 terminal emulator:\
>   :ti=\E[?47h:te=\E[?47l:tc=xterm-xfree86:

47 by itself won't clear the alternate buffer (probably not what is intended).
For more information

http://invisible-island.net/xterm/xterm.faq.html#xterm_tite

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpDDMCRzIVMH.pgp
Description: PGP signature


Re: snippet of configure script - explain please

2008-07-10 Thread Thomas Dickey
On Fri, Jul 11, 2008 at 12:18:42AM +0930, Malcolm Kay wrote:
> On Thu, 10 Jul 2008 09:45 pm, Mel wrote:
> > On Thursday 10 July 2008 06:24:46 Malcolm Kay wrote:
> > 
> > > >9255 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; 
> > > > };
> > > > then

it's interesting, but config.log would probably show the actual check
that was made to fill in the shell variable...

> > > I find this line somewhat strange as I've not been able
> > > to find documentation for the expansion of ${parameter+set} under the
> > > Bourne shell. (nor bash, nor ksh)
> > > *
> > > Presumably someone out there knows where to find it?
> > > *
> > 
> > It's shorthand for ${paramter:+set}, so if unset, you get "", otherwise you 
> > get "set":
> > $ echo ${foo+set}
> > 
> > $ echo ${HOME+set}
> > set
> 
> So it appears; but is it stated anywhere that this shorthand is legitimate?
> I find it quite frequently arising from the GNU configuring tools but
> haven't found it elsewhere.
> 
> Is it a deliberate shorthand or just a consequence of the way sh and bash 
> happen to have been programmed? In other words is it a safe shorthand?

man sh on Solaris for instance:

 ${parameter:+word}
   If parameter is set and is non-null, substitute  word;
   otherwise substitute nothing.

 In the above, word is not evaluated unless it is to be  used
 as  the  substituted string, so that, in the following exam-
 ple, pwd is executed only if d is not set or is null:

  echo ${d:-`pwd`}



SunOS 5.8Last change: 9 May 19974

The same feature is on OpenBSD - I don't have FreeBSD at hand, but
think it's likely to be found in the manpage - I just looked for

/+.*}

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp4mLtSA3Vx5.pgp
Description: PGP signature


Re: null bytes after ANSI sequences in color 'ls' output

2008-06-29 Thread Thomas Dickey
On Sat, Jun 28, 2008 at 10:34:06PM -0700, Mike Brown wrote:
> OK, so the null bytes are correct for vt100 and should've always been there, 
> and the fact that they've suddenly showed up in FreeBSD 6.3 is basically a 
> feature.
> 
> Setting NCURSES_NO_PADDING has no effect, so 'ls' apparently does just use 
> termcap features.

yes - in responding, I saw that while I'd implemented NCURSES_NO_PADDING
for just the curses library, it could be made to work with termcap.
But that's not addressing your immediate question, which Dan did.
 
-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpV9uY2WBo7h.pgp
Description: PGP signature


Re: null bytes after ANSI sequences in color 'ls' output

2008-06-28 Thread Thomas Dickey
On Sat, Jun 28, 2008 at 03:16:21PM -0500, Dan Nelson wrote:
> In the last episode (Jun 28), Thomas Dickey said:
> > It's possible that an application could be sending padding characters
> > (nulls).  The vt100-color terminal description inherits from vt100,
> > which does use padding - but in the sf/sr (scroll forward/reverse).
> 
> If that's the case, then the easy fix would be to tell SecureCRT to
> emulate am xterm instead, and set the terminal type to xterm-color. 
> You would probably get better function key mappings, too.

yes (xterm wouldn't have padding ;-)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp34LjsS2EcF.pgp
Description: PGP signature


Re: null bytes after ANSI sequences in color 'ls' output

2008-06-28 Thread Thomas Dickey
On Fri, Jun 27, 2008 at 07:45:52PM -0700, Mike Brown wrote:
> After I upgraded 6.2-STABLE (Feb 2007-ish) to 6.3-STABLE (last week), my 
> colorized 'ls -G' output is now plagued with 8 null bytes following each ANSI 
> sequence.
> 
> I normally pipe my output to 'less -R' so ANSI sequences pass through while 
> other control characters are converted to visible ones. This worked great 
> until now. Now I see '^@' for each null. It's not a new feature of less, so
> I assume it's ls or curses throwing in the nulls.
> 
> For example, I'm getting output like this if I use 'ls -G | less':
> 
> ESC[36mMailESC[39;[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
> PROTECTED]@[EMAIL PROTECTED]@
> 
> It's the '^@'s that are unexpected, although the repeated ESC[m pairs are 
> also 
> mysterious since they seem to have no purpose.

It's possible that an application could be sending padding characters
(nulls).  The vt100-color terminal description inherits from vt100,
which does use padding - but in the sf/sr (scroll forward/reverse).

Real vt100's require padding (emulators generally do not ;-).

That's the termcap, looking at a not-very-recent copy.

If your terminal description came in part from terminfo, ncurses'
terminfo for vt100 has padding for several features, which can be
disabled for curses apps by setting NCURSES_NO_PADDING in the
environment.

However, I suspect that "ls" is just using termcap features, so that
environment variable may have no effect (depends on what "ls" does
with the termcap string, to write it to the terminal).

But it's something to check/try.
 
> If I use 'ls -G | less -R', then the ANSI sequences pass through as they 
> should, but I still get the nulls.
> 
> 
> Questions:
> 
> Is this is reproducible?
> Should I file a PR?
> 
> FWIW, my tcsh TERM environment variable is vt100-color.
> I'm using SecureCRT with vt100 emulation and ANSI color. 
> 
> Thanks,
> Mike
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpuSYZyT3rbg.pgp
Description: PGP signature


Re: Why doesn't cons25 have cs in termcap info?

2008-06-21 Thread Thomas Dickey
On Sat, Jun 21, 2008 at 11:23:38AM -0400, Thomas Dickey wrote:
> On Fri, Jun 20, 2008 at 08:32:58PM -0400, Kitche wrote:
> > Since some ports actually need cs(change_scroll_region) to run for example
> > tmux is one. I believe tmux does not change the term correctly which could
> > be the issue as well. But according to the author the term needs cs to
> > even run.
> > 
> > I m just wondering why cons25 is missing this from it's termcap, since
> > I've been working on adding it to cons25 so that some ports will work
> > correctly.
> 
> It might be a recent change - I've made a to-do item to investigate it.
> afaik, it's not supported in "older" versions of FreeBSD.
> 
> At the moment for instance, I'm reading the 6.0 source for
> 
>   /usr/src/sys/boot/i386/libi386/vidconsole.c

ditto for 

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/syscons/scterm-sc.c

and

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/boot/i386/libi386/vidconsole.c

> The corresponding screen(4) manpage doesn't mention it.
> 
> (pcvt supports it, but that's a different emulator from cons25).

It sounds as if tmux needs some fixes - cons25 isn't the only terminal
lacking scroll-regions.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpz7BwdNDyAH.pgp
Description: PGP signature


Re: Why doesn't cons25 have cs in termcap info?

2008-06-21 Thread Thomas Dickey
On Fri, Jun 20, 2008 at 08:32:58PM -0400, Kitche wrote:
> Since some ports actually need cs(change_scroll_region) to run for example
> tmux is one. I believe tmux does not change the term correctly which could
> be the issue as well. But according to the author the term needs cs to
> even run.
> 
> I m just wondering why cons25 is missing this from it's termcap, since
> I've been working on adding it to cons25 so that some ports will work
> correctly.

It might be a recent change - I've made a to-do item to investigate it.
afaik, it's not supported in "older" versions of FreeBSD.

At the moment for instance, I'm reading the 6.0 source for

/usr/src/sys/boot/i386/libi386/vidconsole.c

The corresponding screen(4) manpage doesn't mention it.

(pcvt supports it, but that's a different emulator from cons25).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgppnrzuA4k8w.pgp
Description: PGP signature


Re: vim doesn't preserve the terminal content

2007-11-03 Thread Thomas Dickey
On Fri, Nov 02, 2007 at 04:00:05PM -0700, Pete Slagle wrote:
> Yuri wrote:
> 
> > I use vim both on Linux and FreeBSD.
> > On Linux after I exit vim original screen content is restored.
> > On FreeBSD vim leaves the last content viewed in vim.
> > 
> > How do I make vim preserve the screen?
> > 
> > Thanks,
> > Yuri
> 
> This behavior is controlled by xterm settings.

I didn't notice that he mentioned xterm
(if he's not using xterm, it's harder to fix ;-)
 
> Try holding the control key and middle-clicking with the mouse on an
> xterm window. You should see an "Enable Alternate Screen Switching" option.
> 
> See 'man 1 xterm' or http://www.x.org/archive/X11R6.8.0/doc/xterm.1.html

http://invisible-island.net/xterm/xterm.faq.html#xterm_tite
http://invisible-island.net/xterm/manpage/xterm.html

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpRWaizlHUvA.pgp
Description: PGP signature


Re: What to use for conio?

2007-09-15 Thread Thomas Dickey
On Sat, Sep 15, 2007 at 03:11:54AM -0500, Lars Eighner wrote:
> What I really want to do:  capture keypresses (including function keys) from
> a (virtual) terminal without their echoing or without having to enter
> a new line (i.e. hit return).

man newterm
man filter

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgppzDyGLjjgl.pgp
Description: PGP signature


Re: mc (GNU midnight commander) have I18N problem on FreeBSD?

2007-07-22 Thread Thomas Dickey
On Sun, Jul 22, 2007 at 04:05:35PM +0800, Zhang Weiwu wrote:
> Dear list
> 
> I found mc 4.6.1 behave differently on FreeBSD 6.2 and SuSE 10.2
> 
> 1) run urxvt on FreeBSD 6.2
> 2) run mc 4.6.1, take a screenshot:

perhaps FreeBSD's port for mc has one of the UTF-8 patches,
perhaps it does not.  There's no official upstream patch for it.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp37i2MqiHDJ.pgp
Description: PGP signature


Re: Re[2]: Increase in the number of ports: upgrade xorg to 7.2...

2007-06-08 Thread Thomas Dickey
On Fri, Jun 08, 2007 at 03:34:38PM -0400, Bill Moran wrote:
> > I am not totally convinced. If one small package is updated that is
> > depended on by 10 other package that in turn are depended on by a like
> > number of other packages, what has been really gained by breaking
> > everything into small bits? They may be easier to maintain; however
> > the impact on updating the system seems like it would be minimal.
> 
> No.  As long as the communication interface between modules (whether
> it be an API or something else) doesn't change, it's perfectly possible
> to update a single module without updating anything else.

"as long as" is an assumption which I haven't seen any evidence that 
xorg developers are willing to warrant.

fwiw, they changed interface in the Xaw library a couple of years ago,
which required some a change to xterm.

Absent any evidence that they're going to maintain stable interfaces,
this is just an assumption.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpKwRHAuHW1J.pgp
Description: PGP signature


Re: See output of local xterm session on remote ssh session.

2007-06-02 Thread Thomas Dickey
On Sat, Jun 02, 2007 at 01:39:08PM +0200, Roland Smith wrote:
> If you want to keep tabs on an already running process, you should start
> the process in such a way that it redirects the standard output and
> standard error streams to a file. How that's done depends on the shell
> you're using. You can then watch that file via ssh with 'tail -f'.

'script' is less intrusive (and allows one to capture _everything_ sent
to the terminal - ymmv)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpkKIN4lZWjq.pgp
Description: PGP signature


Re: Wikipedia's perfection (was Re: Discussion of the relativeadvantages/disadvantages of PAE (was Re: Memory >3.5GB not used?))

2007-04-28 Thread Thomas Dickey
On Sat, Apr 28, 2007 at 02:10:16AM -0700, Ted Mittelstaedt wrote:
> The true value of Wikipedia is that it can deal with controversial
> subjects.  ...

on the other hand, for some instances it doesn't _deal_ with controversial
subjects, but only reflects the most common opinion.  Currently(*) the only
way to see what's going on is to examine the history of changes to a given
page, taking into account that since the updaters are anonymous there's
no guarantee that one can relate their opinions to facts.

(*) is there a guarantee that the change history will remain?  If not,
at that point one may as well delete wikipedia.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpJqza17EWwO.pgp
Description: PGP signature


Re: best programming language for console/sql application?

2007-04-26 Thread Thomas Dickey
On Thu, Apr 26, 2007 at 02:35:39PM +0800, Zhang Weiwu wrote:
> There are a lot! There are no known console-based bug tracker 
> (there are also a lot of console-based bug reporter)

I use lynx to update comments on Redhat's bugzilla.
That's console-based.
(It also uses ncurses)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpLisOpDdhKQ.pgp
Description: PGP signature


Re: first of misc questions....

2007-04-25 Thread Thomas Dickey
On Wed, Apr 25, 2007 at 10:31:45PM +0200, Irsla wrote:
> On 4/25/07, Matthew Seaman <[EMAIL PROTECTED]> wrote:
> >
> >   find . -type f \( -mtime 6 -o -mtime 29 \) -print0 | xargs -0 vi
> >
> 
> what about the -exec option of find ? I always wonder why people don't use 
> it.

it's simpler but not necessarily as efficient.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpQclkpjotjq.pgp
Description: PGP signature


Re: Wikipedia's perfection (was Re: Discussion of the relative advantages/disadvantages of PAE (was Re: Memory >3.5GB not used?))

2007-04-25 Thread Thomas Dickey
On Wed, Apr 25, 2007 at 01:58:55PM -0600, Chad Perrin wrote:
> I definitely agree that's suboptimal.  I'd expand that to include other
> sorts of pages, other than webpages, as well.  It's pretty rare for this
> particular brand of intellectually lazy person to realize that about the
> printed page, though.

I recall reading some interesting comments from studies (second hand, e.g.,
in Science News) which stated that people tended to believe things that
were presented in a credible fashion, not questioning them - using the
paper or page as an authority which amplified their own general beliefs
on a topic.

Aside from the circular referencing that occurs when believing that...

It's certainly hard to see where/how to decide to stop and question the
authority, given that premise (knowing that one is biased).  But it's
perhaps a good habit to get into - observing that reading things that
one already agrees with are perhaps as problematic as those that one
does not.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp841KNhNsK7.pgp
Description: PGP signature


Re: Wikipedia's perfection (was Re: Discussion of the relative advantages/disadvantages of PAE (was Re: Memory >3.5GB not used?))

2007-04-25 Thread Thomas Dickey
On Wed, Apr 25, 2007 at 01:15:03PM -0600, Chad Perrin wrote:
> No kidding.  That professor should have his Wikipedia account banned,
> and the head of his department should be informed of his vandalism.  I
> don't suppose you know the name of his Wikipedia account, or his legal
> name. . . .

yawn.  That sort of research has been going on for years.

Less interesting is the sort of trash emitted by people who don't like
knowing that whatever they've read on a webpage might not be completely
accurate, and that they might have to do some of their own thinking.

regards.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpR3piQ1RU0q.pgp
Description: PGP signature


Re: Discussion of the relative advantages/disadvantages of PAE (was Re: Memory >3.5GB not used?)

2007-04-25 Thread Thomas Dickey
On Wed, Apr 25, 2007 at 08:31:53AM -0400, Bill Moran wrote:
> (of course, everyone knows that Wikipedia is the ultimate source of
> information and is infallible, right?)

hardly.  I'd expect that most intelligent readers would have encountered
at least one wikipedia article which is inaccurate.  Like any source
of information, it's only a starting point.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgplMDDE4MqM3.pgp
Description: PGP signature


Re: Code beautification and/or printing utilities that are not part of an editor

2007-04-19 Thread Thomas Dickey
On Thu, Apr 19, 2007 at 03:10:47PM -0600, Andrew Falanga wrote:
> Another question for everyone.  Are there any programs, hopefully
> available in the ports, that one can use to print source code files to
> a printer (or create as a postscript file)?
> 
> I'd like something that I can feed a C++ program, have it parse
> through the code, print line numbers to the left of the page and
> (optionally) color code the syntax.  Does anything like this exist?

http://www.codento.com/people/mtr/genscript/

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpLIsp8XGWV5.pgp
Description: PGP signature


Re: UTF-8 in console

2007-04-04 Thread Thomas Dickey
On Thu, Apr 05, 2007 at 12:02:12AM +0200, Nejc ©koberne wrote:
> Hello,
> 
> I am have many FreeBSD 5.x and 6.x servers installed and I have this in my
> /etc/profile:
> 
> LANG=sl_SI.UTF-8; export LANG
> MM_CHARSET=UTF-8; export MM_CHARSET
> 
> because I am using UTF-8 encoding with PuTTY. It works with most 
> applications
> but not with "dialog". For example, I get this when using UTF-8:

dialog is probably built/linked with the normal "libncurses" rather than
"libncursesw" (and corresponding configure option to use the
wide-character features).  That's one part of the problem.

Another is that PuTTY does not honor VT100-style line-drawing when it's
doing UTF-8.  You can tell ncurses that's the case by setting the
NCURSES_NO_UTF8_ACS environment variable (added 20050312).  Then it'll
use +'s and -'s, etc., to do ASCII line-drawing.  To get nice
line-drawing in PuTTY in UTF-8, you have to use the wide-character
libncursesw.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpOt4bqsJtmE.pgp
Description: PGP signature


Re: Gnome-Terminal - odd behaviour while typing

2007-03-10 Thread Thomas Dickey
On Sat, Mar 10, 2007 at 01:48:00PM +0100, Carsten Fuchs wrote:
> Hi everyone!
> 
> My gnome-terminal has this annoying habit of jumping at the beginning
> of the same line when i'm entering a command and the cursor reaches a
> certain column (not the last column possible, there's always a quarter
> or so of the line left blank); it doesn't put the cursor on a new line
> but at the beginning of the same line, thus overwriting that line.

Sounds like a problem with the prompt string (iirc for bash users, that's
remedied by escaping the chunk of text that doesn't print using \[ and \]).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Backspace key "<-" not mapping to ^H

2007-02-28 Thread Thomas Dickey
On Wed, Feb 28, 2007 at 06:33:54AM -0800, Garrett Cooper wrote:
> Jordan Gordeev wrote:
> >Gary Kline wrote:
> >>I'm not sure whether this just in Ubuntu or in the Gnome desktop
...
> >>servers.  I thought I'd ask here before I dig into this.  I think
> >>a new xterm was recently updated in ports; not  sure if tat is a
> >>factor or not.

no (I don't recall making changes in that area).

> >See stty(1) and termios(4). You should modify the erase or erase2 values.

reasonable (Ubuntu uses Debian packages iirc, which makes it use DEL,
FreeBSD uses BS for erase, etc).
 
> The terminal settings available from gnome (if you open up an xterm / 
> Gnome terminal shell using the Terminal command under the menu) has 

gnome-terminal isn't xterm (OP isn't making that distinction either).

xterm has menu settings which can change the assignment of BS/DEL to the
"backspace" key (unlike gnome-terminal, it has a manpage describing these
details ;-).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp4lCGMpHXwv.pgp
Description: PGP signature


Re: ssh to VMS - terminal problems

2007-02-22 Thread Thomas Dickey
On Thu, Feb 22, 2007 at 01:04:39AM -0800, [EMAIL PROTECTED] wrote:
> > > yes - VMS only knows about DEC-compatible terminals.  None of
> > > the *BSD console emulators do well enough to be usable on VMS.
> > > 
> > > xterm supports ANSI color, VT220 emulation and UTF-8
> > > There's an faq at
> > >   http://invisible-island.net/xterm/xterm.faq.html
> > >   ftp://invisible-island.net/xterm/
> 
> Which is fine if one doesn't mind having to fire up X.  Another
> possible approach would be to run ports/sysutils/screen, which
> "should" provide a decent VT100 over just about anything with a
> terminfo better than "dumb" or "unknown" :)

termcap.

screen doesn't use the fancier features from terminfo (and will do interesting
but unuseful things if it is exposed to them).

It's a decent vt100 for the same issues: applications running vi.
Read the section on bugs (from its manpage):

 o  Screen has  no  clue  about  double-high  or  double-wide
characters.  But  this  is  the only area where vttest is
allowed to fail.

 o  Screen does not make use of hardware tabs.

However, that comment about vttest overlooks some of the keyboard
issues (such as repeating keys) that screen has no control over.
There are several terminals smarter than dumb/unknown that screen
cannot elevate or transform into a vt100...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpjxK4gxyFIF.pgp
Description: PGP signature


Re: ssh to VMS - terminal problems

2007-02-20 Thread Thomas Dickey
On Tue, Feb 20, 2007 at 07:05:37PM +, Anton Shterenlikht wrote:
> On Tue, Feb 20, 2007 at 11:45:17AM -0500, Thomas Dickey wrote:
> > On Tue, Feb 20, 2007 at 03:51:57PM +, Anton Shterenlikht wrote:
> > 
> > > If I run ssh from a terminal emulator in xorg, all seems fine.
> > 
> > yes - VMS only knows about DEC-compatible terminals.  None of the *BSD
> > console emulators do well enough to be usable on VMS.
> > 
> > xterm supports ANSI color, VT220 emulation and UTF-8
> > There's an faq at
> > http://invisible-island.net/xterm/xterm.faq.html
> > ftp://invisible-island.net/xterm/
> 
> thanks a lot.
> 
> So, what was pcvt driver designed for? I understood from the man
> pages that it is supposed to be compartible with DEC function keys?

Most of these drivers are just good enough to run vi (so they can use
a termcap written to accommodate a DEC terminal).

VMS wants more than just function keys - the terminal has to respond
to control sequences that ask what it is, for instance.  I see from
the show-terminal that it either guessed that it was a VT100, or that
it was told that it was.

If you capture the output from the host with 'script', you can see what's
sent to the terminal. Seeing the replies is harder, but that might provide
some clues.

Running vttest would show some of the issues (for a 25-line console
screen, that would be something like "vttest 25x80.80" to make it workable).

That reminds me -
Of course VMS thinks you have 24 lines (which makes all of the scrolling
not work properly).  You can modify that setting (the "page" in the "show
term").  There are other likely problems...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: ssh to VMS - terminal problems

2007-02-20 Thread Thomas Dickey
On Tue, Feb 20, 2007 at 03:51:57PM +, Anton Shterenlikht wrote:

> If I run ssh from a terminal emulator in xorg, all seems fine.

yes - VMS only knows about DEC-compatible terminals.  None of the *BSD
console emulators do well enough to be usable on VMS.

xterm supports ANSI color, VT220 emulation and UTF-8
There's an faq at
http://invisible-island.net/xterm/xterm.faq.html
ftp://invisible-island.net/xterm/

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Ksh Shell script security question.

2007-02-15 Thread Thomas Dickey
On Wed, Feb 14, 2007 at 10:57:12PM -0600, Dan Nelson wrote:
> In the last episode (Feb 14), Dak Ghatikachalam said:
> > I am am puzzled how to secure this code when this shell script is
> > being executed.
> > 
> > ${ORACLE_HOME}/bin/sqlplus -s  < >connect system/ugo8990d
> >set heading off
> >set feedback off
> >set pagesize 500
> >select 'SCN_TO_USE | '||max(next_change#)   from V\$LOG_HISTORY;
> >quit
> > EOF
> > 
> > When I run this code from shell script in /tmp directory it spews
> > file called /tmp/sh03400.000 in that I have this entire code visible.
> 
> I bet if you check the permissions you'll find the file has mode 0600,
> which means only the user running the script can read the file (at
> least that's what a test using the pdksh port does on my system). 
> ksh93 does have a problem, though: it opens a file and immediately
> unlinks it, but the file is world-readable for a short time.

Doesn't it (ksh93, etc) pay attention to umask?
If it does, the script should use that feature.

> 
> Both ksh variants honor the TMPDIR variable, though, so if you create a
> ~/tmp directory, chmod it so only you can access it, then set
> TMPDIR=~/tmp , you will be secure even if you're using ksh93.

relatively (it's not a given that people haven't opened up ~/tmp)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpKiemVJGeeu.pgp
Description: PGP signature


Re: Newbie Lynx and Mozilla Firefox Questions

2007-01-04 Thread Thomas Dickey
On Thu, Jan 04, 2007 at 09:42:25AM -0800, Bill Campbell wrote:
> On Thu, Jan 04, 2007, linux quest wrote:
> 
> >I have been searching for tutorials for browsing the Internet using Lynx,
> >but can’t seem to find one anywhere. There aren’t any tutorial either in
> >those Unix books that I bought. What command do I need to type to download
> >Lynx and what command I need to type to run Lynx on FreeBSD?
> 
> You might also want to look at ``links'', a character browser
> that does frames which may be more useful than lynx.

Actually (though this is a poor forum for technical discussion),
lynx allows one to navigate through frames as if they are a separate page.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpPYEHcFLtUm.pgp
Description: PGP signature


Re: Midnight Commander in base distribution set

2006-08-06 Thread Thomas Dickey
On Sun, Aug 06, 2006 at 04:44:26PM +0300, Simon Phoenix wrote:
> On Friday 04 August 2006 09:41, Renat S. Nurgaliyev wrote:
> > Please, please, please, include Midnight Commander into the future
> > releases of FreeBSD! It is extremely time-safing and lightweight tool. It
> > can be installed from ports, but what about disconnected PC's? Thanks a
> > lot.
> 
> IMHO no reason for this. Many users never use mc or use another file manager.

otoh, when I demo'd a version of dired 20-odd years ago to Dick Wexelblat,
he commented that it was like getting eyes.

ymmv

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp3Q5wILPh10.pgp
Description: PGP signature


Re: Midnight Commander in base distribution set

2006-08-04 Thread Thomas Dickey
On Fri, Aug 04, 2006 at 03:21:06PM -0400, Xiao-Yong Jin wrote:
> > This is more lightweight than mc, and does things that mc doesn't:
> >
> > http://invisible-island.net/ded/
> >
> Interesting.  You can try to make it into the ports tree.

I could - but generally am too busy working on development to be much more
involved with packaging than by giving advice...

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgppd4OhkH3nT.pgp
Description: PGP signature


Re: Midnight Commander in base distribution set

2006-08-04 Thread Thomas Dickey
On Fri, Aug 04, 2006 at 02:11:20PM -0400, Xiao-Yong Jin wrote:
> Dan Nelson <[EMAIL PROTECTED]> writes:
> 
> > In the last episode (Aug 04), Andrew Gould said:
> >> --- Scott Oertel <[EMAIL PROTECTED]> wrote:
> >> > I use midnight commander on a daily basis, can anyone recommend a
> >> > better, more lightweight tool then mc?
...
> > Actually, mc is pretty lightweight if you disable all the options.  Note

;-)

> Anyway, for a base system, it's still a bit heavy.  In fact, one can
> always do anything with cp/mv  I believe the base system should
> only include the simplest solution, that is, the most fundamental
> tools one needs, and without redundancy.

"anything", given enough time/energy.

This is more lightweight than mc, and does things that mc doesn't:

http://invisible-island.net/ded/

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp6LsdIcAZZm.pgp
Description: PGP signature


Re: termcap vs terminfo, less, and Mac OS X

2006-06-02 Thread Thomas Dickey
On Fri, Jun 02, 2006 at 02:26:07PM -0700, Walt Pawley wrote:
> I've been messing about with FreeBSD lately, though mostly I
> use Mac OS X. I've grown accustomed to using "less" as a pager,
> generally preferring the manner in which it would make all the
> scrolled through crud vanish when I was done pawing about in
> it. But "less" didn't behave that way when telnet'd into the
> the FreeBSD boxes on the LAN - whatever got presented scrolled
> "up" into the terminal program's capture buffer.
> 
> After mucking with this for a couple of days, I believe the
> reason is that the termcap description of "xterm-color" in
> FreeBSD doesn't match the "xterm-color" terminfo description in
> either Mac OS X or Linux (which seem to be identical). In
> particular, the "ti" and "te" capabilities are null.

Most of the Linux's have xterm-color the same as in ncurses.
A couple (I've observed) do as in Mac OS X and choose some flavor of
xterm to replace it.  There's no standard choice for the replacement.

The choice of whether to have ti/te null is arbitrary (half of xterm's
users like the alternate screen, half don't).
 
> Is this intentional or something that should be generically "fixed"?

The fix is simply not to use "xterm-color".  It doesn't correspond to
any terminal type, is useful only to people who don't care to find out
what the terminal is.

For instance, you've not identified the terminal type.  Find out what
it is...

xterm supports ANSI color, VT220 emulation and UTF-8
There's an faq at
http://invisible-island.net/xterm/xterm.faq.html
ftp://invisible-island.net/xterm/

The current version of ncurses is 5.5 (20051010)
There's an faq at
http://invisible-island.net/ncurses/ncurses.faq.html

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpL4ZoDPaNQN.pgp
Description: PGP signature


Re: Converting a zsh prompt to bash

2006-05-19 Thread Thomas Dickey
> Hey Dan!
> 
> Your prompt is truly wonderful.
> It inspired me to grow up, as far as my shell is concerned.

hmm - no: grownups use tput rather than hardcoding things.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpaAKCgMiHgm.pgp
Description: PGP signature


Re: Zero Copy, FreeBSD and Linus Torvalds opinion

2006-05-01 Thread Thomas Dickey
On Sun, Apr 30, 2006 at 10:04:22PM -0700, Frank Mayhar wrote:

> "It is better to remain silent and be thought a fool, than to speak, and
> remove all doubt."

Given the tone of the recent discussions, it's apparent you're referring
to the comments on this list.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgp12YPLPmU46.pgp
Description: PGP signature


Re: Xemacs cursor in console

2006-03-26 Thread Thomas Dickey
On Sun, Mar 26, 2006 at 04:28:31PM +0300, User Elisej wrote:
> I use XEmacs 21.4 (patch 19)
> It sets the cursor as large blinking block on its own everytime.
> How to forbid it this?

It's using the terminal settings (terminfo cvvis, termcap vs) to see
how to do this.  FreeBSD provides only rudimentary support for customizing
your terminal description (the preferred solution); and chosing an alternative
description can be frustrating (apparently the recommended solution ;-)

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpxBZafI0FqP.pgp
Description: PGP signature


Re: groff alternative?

2005-04-26 Thread Thomas Dickey
On Tue, Apr 26, 2005 at 08:10:41PM +0200, Emanuel Strobl wrote:
> 
> Does anybody know any alternative for the groff part to view man pages simply 
> with the man command? It's horrible that the filter needs more space than all 
> the manpages itself!

perhaps "cawf"

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


pgpiS458hC1Aj.pgp
Description: PGP signature