DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th August 2012
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 89
Thanked 0 Times in 0 Posts
Default "Ctrl+l" doesnot clear xterm

I am used to press "Ctrl+l" to clear xterm window. But it seems not to work in OpenBSD 5.1 where i have to input `clear`.


Regards!
Reply With Quote
  #2   (View Single Post)  
Old 17th August 2012
denta denta is offline
Fdisk Soldier
 
Join Date: Nov 2009
Posts: 73
Thanked 0 Times in 0 Posts
Default

I'm pretty sure ^L only clears the entire screen in readline(3) applications (look for "clear-screen" in the man page). So my guess is that xterm does not use readline, which probably makes sense since readline itself is GNU software.
Reply With Quote
  #3   (View Single Post)  
Old 20th August 2012
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 89
Thanked 0 Times in 0 Posts
Default

But ^L works on FreeBSD's xterm.

$pkg_info -Qx xterm
xterm-276_1:Terminal emulator for the X Window System
Reply With Quote
  #4   (View Single Post)  
Old 20th August 2012
denta denta is offline
Fdisk Soldier
 
Join Date: Nov 2009
Posts: 73
Thanked 0 Times in 0 Posts
Default

Ksh doesn't use readline, while bash does. Change shell from ksh to bash and ^L will clear the screen in xterm.
Reply With Quote
  #5   (View Single Post)  
Old 20th August 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 562
Thanked 14 Times in 13 Posts
Default

It also seems to require a capable TERM setting. E.g., I find it works with TERM=xterm-color, but not inside tmux where TERM=screen.
Reply With Quote
  #6   (View Single Post)  
Old 21st August 2012
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 89
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by IdOp View Post
It also seems to require a capable TERM setting. E.g., I find it works with TERM=xterm-color, but not inside tmux where TERM=screen.
Code:
$ echo $TERM
xterm-color
^L still doesnot work ! Maybe @denta is right, i need to use bash instead of ksh.


Regards!
Reply With Quote
  #7   (View Single Post)  
Old 21st August 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 562
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by sw2wolf View Post
^L still doesnot work ! Maybe @denta is right, i need to use bash instead of ksh.
denta is certainly right, the ^L thing is a default binding of GNU readline. To confirm that see readline's manpage and look for the clear-screen function. So using readline, such as through bash, is necessary if ksh doesn't use it.

What I was saying is that, in addition to readline, the terminal must be capable.

And now further clarification. Yesterday when it didn't work for me with TERM=screen, I was using Linux. Today, using NetBSD, it does work with TERM=screen. I take from this that while the terminal must still be capable, yet terminals with the same name may have subtle differences from one implementation to another that may or may not break this. What happens on the latest OpenBSD I don't know but it's worth having in mind if you should try it.
Reply With Quote
  #8   (View Single Post)  
Old 22nd August 2012
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 89
Thanked 0 Times in 0 Posts
Default

Thanks IdOp !
On my freebsd + tmux + csh, ^L works with TERM set to "xterm-256color"

Regards!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to replace "ectags" with "ctags"? fender0107401 OpenBSD Packages and Ports 5 16th April 2013 10:01 AM
Where should I put my config? "rc.conf" or "rc.conf.local"? fender0107401 OpenBSD General 2 2nd April 2012 02:53 AM
wpa_supplicant errors: "CTRL-EVENT-SCAN-RESULTS" jackburke FreeBSD General 0 1st February 2010 12:07 AM
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" jb_daefo Guides 0 5th October 2009 09:31 PM
"Thanks" and "Edit Tags". diw Feedback and Suggestions 2 29th March 2009 12:06 AM


All times are GMT. The time now is 06:16 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick