configuration of tty on BSD system

631 Views Asked by At

For a command like this one on Linux debian-linux 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux with xfce I get :

alain@debian-linux:~$ dbus-send --system --type=method_call --print-reply --dest
=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListActivatable  
Names

The same command on OpenBSD LeOpenBSD 6.4 GENERIC.MP#364 amd64 with xfce I get :

ktop/DBus org.freedesktop.DBus.ListActivatableNames   <

On linux, at the end of screen, we go to next line.
On BSD(OpenBSD-NetBSD), the command line continue on the same line and the first words disapear.
It's the same in xfce-terminal-emulator, xterm or in TTY (Alt-Ctrl-F3)

I try to add am in gettytab in the defaut section with no avail.
Termcap man page say :
If the display wraps around to the beginning of the next line when the cursor reaches the right margin, then it should have the am capability.
What can I do ?

2

There are 2 best solutions below

0
Greg A. Woods On BEST ANSWER

I think what you're actually describing may be a difference between the two very different shells used on Linux and most BSDs and their very different command-line editing implementations.

This probably has nothing to do with differences between various terminal emulator implementations; nor with differences between terminal capabilities databases describing those terminal emulations.

On the BSD system(s) the default shell's command-line editor scrolls the whole like across the width of the screen depending on the position of the cursor. On some Linux systems I've seen the default shell's command-line editor wrap long lines around to continue on the next line.

3
Mathieu Kerjouan On

Short answer

If you want to your current shell without this feature

set +o emacs

If you want to spawn a new shell without this feature

ksh +o emacs

Long answer

This behavior is mainly due to the shell input interactive editing mode supported on OpenBSD.

In these editing modes, if a line is longer than the screen width (see the COLUMNS parameter), a ‘>’, ‘+’, or ‘<’ character is displayed in the last column indicating that there are more characters after, before and after, or before the current position, respectively. The line is scrolled horizontally as necessary.

If you want to remove this feature, you can use set build-in command present in sh or ksh. You can also remove this flag during invocation by using +o

Finally, if you want to check if some interactive editing modes are enabled on your current shell, you can invoke set -o or set +o without argument. It will give you something like that, here the set -o command:

$ set -o
Current option settings
allexport      off  keyword        off  notify         off  verbose        off 
braceexpand    on   login          on   nounset        off  vi             off 
bgnice         off  markdirs       off  physical       off  viraw          off 
csh-history    off  monitor        on   posix          off  vi-show8       off 
emacs          off  noclobber      off  privileged     off  vi-tabcomplete on  
errexit        off  noexec         off  restricted     off  vi-esccomplete off 
gmacs          off  noglob         off  sh             off  xtrace         off 
ignoreeof      off  nohup          on   stdin          on   
interactive    on   nolog          off  trackall       off

and here the set +o command:

$ set +o
set +o allexport -o braceexpand +o bgnice +o csh-history +o emacs +o errexit 
+o gmacs +o ignoreeof -o interactive +o keyword -o login +o markdirs -o monitor 
+o noclobber +o noexec +o noglob -o nohup +o nolog +o notify +o nounset 
+o physical +o posix +o privileged +o restricted +o sh -o stdin +o trackall 
+o verbose +o vi +o viraw +o vi-show8 -o vi-tabcomplete +o vi-esccomplete 
+o xtrace