From owner-freebsd-questions@FreeBSD.ORG Wed Feb 6 08:11:06 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20588C79 for ; Wed, 6 Feb 2013 08:11:06 +0000 (UTC) (envelope-from sam.gh1986@gmail.com) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD126A9 for ; Wed, 6 Feb 2013 08:11:05 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id n8so957695lbj.3 for ; Wed, 06 Feb 2013 00:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=pf2HMHSQRFZezGO6/6eQLx8JvDV5mZpdFouq7BfWiT4=; b=IfBxD2BpG3EGfx/rfzFh8RoXOE7TmKZOsKIJeQJTfhRnfXuD1QIFy4pa56xWDrjT9g 9S7boRfDx1ZbY6jMH+cwfyWJZEJn6SWAM4474k8x+DpI0CxIXTM4cDAav5ew0X3CUSey 82oa8UQX97s1QFLUz10x+ruGW9fXqOaCiEVYzUgtiFOt37eGM6qpJk8UaEGufkOKOWAl uO3chvd6w2CNzkZqwZYdae4v0ypLXQlQynFwVhBFLMvi0vy51iieGIuPuv6pnpXWQlT/ HhEpvKNohovp1d9Lo6wIxdtaDKGOSjqgWlp8uAo7Pzkb069WZRdEoYJYrRA1sL2O8a3B 9RPw== MIME-Version: 1.0 X-Received: by 10.152.144.4 with SMTP id si4mr25427027lab.10.1360138257884; Wed, 06 Feb 2013 00:10:57 -0800 (PST) Received: by 10.112.143.201 with HTTP; Wed, 6 Feb 2013 00:10:57 -0800 (PST) In-Reply-To: <20130206075050.b4e5b48e.freebsd@edvax.de> References: <20130206075050.b4e5b48e.freebsd@edvax.de> Date: Wed, 6 Feb 2013 11:40:57 +0330 Message-ID: Subject: Re: backspace shows ^? in serial communications From: s m To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 08:11:06 -0000 thanks for your answer. you know, i have a freebsd box (something like router) which i connect to it by putty or other terminal programs (cu,...). this router has a serial card and i have a c program to open and manage serial ports. now when i run this c program and connect to the third freebsd box, backspace shows ^?. now i don't know where is problem and for which system terminal settings should be checked. from you explanation i think that i should check serial settings in c program in the router box. am i right? please let me know what should i do to this program (c program in router box) show backspace correctly when i connect by different serial programs to router box and run it. thanks On Wed, Feb 6, 2013 at 10:20 AM, Polytropon wrote: > On Wed, 6 Feb 2013 09:44:37 +0330, s m wrote: > > hi all > > > > i have a problem with backspace in serial communications. i have a > > freebsd8.2 box with a serial card on it. when i connect to other freebsd > > box via serial port backspace does not act as i expected. backspace shows > > ^? on screen. i searched alot and find out that stty has two parameters > > -erase and erase2- to identify erase characters in terminal and they > should > > be set correctly. i set erase and erase2 to ^? by "stty erase \^?" and > > "stty erase2 \^?" commands but nothing happened. > > please let me know how i can fix it. i know it is simple issue but i > really > > do not know how to do that. > > If I remember correctly, ^? is delete, ^H is backspace. You > should check your terminal emulator if it outputs ^? instead > of ^H when you press the backspace key. > > FreeBSD's default configuration handles keys correctly (if > you have the proper terminal emulation set, e. g. vt100 or > vt220 for your serial line), so there's probably something > wrong with the settings of the terminal program you're using. > > For comparison: > > % echo $TERM > xterm > % stty -a > speed 9600 baud; 24 rows; 80 columns; > lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl > -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo > -extproc > iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany -imaxbel -ignbrk > -brkint -inpck -ignpar -parmrk > oflags: opost onlcr -ocrnl tab3 -onocr -onlret > cflags: cread cs8 parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow > -dtrflow -mdmbuf > cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; > eol2 = ; erase = ^H; erase2 = ^H; intr = ^C; kill = ^U; > lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; > status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; > > And: > > % echo $TERM > cons25l1 > % stty -a > speed 9600 baud; 25 rows; 80 columns; > lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl > -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo > -extproc > iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk > brkint -inpck -ignpar -parmrk > oflags: opost onlcr -ocrnl tab0 -onocr -onlret > cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow > -dtrflow -mdmbuf > cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; > eol2 = ; erase = ^H; erase2 = ^H; intr = ^C; kill = ^U; > lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; > status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; > > If you want the system's C shell to treat ^? (delete) as > it should be treated (perform delete instead of backspace > or "nothing"), add those to your .cshrc: > > bindkey ^? delete-char # for console > bindkey ^[[3~ delete-char # for xterm > > Note that this only affects the C shell. > > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... >