From owner-freebsd-questions@FreeBSD.ORG Mon Feb 11 11:37:04 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3716D40 for ; Mon, 11 Feb 2013 11:37:04 +0000 (UTC) (envelope-from saeedeh.motlagh@gmail.com) Received: from mail-la0-x232.google.com (la-in-x0232.1e100.net [IPv6:2a00:1450:4010:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id 2E20F1F9F for ; Mon, 11 Feb 2013 11:37:04 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ec20so5702796lab.37 for ; Mon, 11 Feb 2013 03:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=szp7R3RDMrPyPHXh+G7syJoUhIMFkF+pySlGVD+1iJs=; b=ucpyeOEn71De6CRbMJYBHYHiCdRiL5adLs+j7WZzD0iE12pmPh+dNp6ufv3yC9xftD CpQ8noNIVUoDSkxh2C0c9cJIV49JOXEA4YqJlfLAqKYjzYy8GGRkPPMSX3YUvuSbYs4R kd01ATbLAf4gMu1AdxjO5os7gbqJNWZ/o3L4geLFndD9UPBUiMZCrswoP83GHOKGCY86 kKsfYU7N+cS7DJavth6SgDX3qtoSYrRHZAnCdsDkIZTwZrxb6wi2uoe1T8cWxIgiys2a BGQYIN2alqiRRhmEzhyQSHN3PF1d1mhBANpZqx9KWRdgS7XHj7PnHA1D1kmvlc5UKM6S fHkw== X-Received: by 10.112.17.137 with SMTP id o9mr5767414lbd.15.1360582623168; Mon, 11 Feb 2013 03:37:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.87.132 with HTTP; Mon, 11 Feb 2013 03:36:22 -0800 (PST) From: saeedeh motlagh Date: Mon, 11 Feb 2013 15:06:22 +0330 Message-ID: Subject: backspace doesn't work correctly with termios To: freebsd-questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Mon, 11 Feb 2013 11:37:04 -0000 hi all i have problem with backspace in serial communication. this is my scenario: i have three box. box number 1 is windows system, number 2 is freeBSD8.2 and number 3 is cisco router. from box number 1 i connect to the box number 2 by putty and run a serial program on box number 2 that connects to box number 3 via a serial card. this serial program uses termios structure and manage opening, reading, writing and closing serial ports. my problem is: when i connect to box number 2 via putty, everything is okand backspace works correctly but when i run serial program and connect to the box number 3 via it, backspace do not work correctly and print ^? on screen. i searched a lot and check stty erase and erase2 options. moreover i set VERASE in termios too but nothing happened. what is the correct setting for termios to identify backspace as it should be? how can i understand what key mappings is done when i press backspace in box number 1 to erase character in the terminal of box number 3? i think some thing is wrong in termios options that causes mismatch in backspace translation. this problem has kept me busy for more than a month and i really don't know what should i do to solve it. any comments or hints are really appreciated. motlagh