Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52798

Re: Raw_input with readline in a daemon thread makes terminal text disappear

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <random832@fastmail.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:text': 0.05; '21,': 0.07; 'modes': 0.09; 'received:internal': 0.09; 'creates': 0.14; 'thread': 0.14; 'message-id:@webmail.messagingengine.com': 0.16; 'mode,': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:compute4.internal': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'ssh': 0.16; 'subject: \n ': 0.16; 'suspects': 0.16; 'thread,': 0.16; 'thread?': 0.16; 'tty': 0.16; 'url:unix': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'all,': 0.19; 'module': 0.19; 'pieces': 0.19; 'input': 0.22; '(in': 0.22; 'aug': 0.22; 'text,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'gets': 0.27; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'wondering': 0.29; 'mode': 0.30; "i'm": 0.30; 'code': 0.31; 'fighting': 0.31; 'probably': 0.32; 'handled': 0.32; 'run': 0.32; 'running': 0.33; 'not.': 0.33; 'skip:d 20': 0.34; 'received:66': 0.35; 'subject:with': 0.35; 'but': 0.35; 'google': 0.35; 'doing': 0.36; 'should': 0.36; 'so,': 0.37; 'two': 0.37; 'received:10': 0.37; 'work?': 0.38; 'to:addr :python-list': 0.38; 'issue': 0.38; 'does': 0.39; '(from': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; 'from:no real name:2**0': 0.61; 'simple': 0.61; 'back': 0.62; "you've": 0.63; 'header:Message-Id:1': 0.63; 'different': 0.65; 'forward': 0.65; 'prime': 0.74; 'behavior': 0.77; '2013,': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:from:to:cc:mime-version:content-transfer-encoding :content-type:subject:date:in-reply-to:references; s=mesmtp; bh= ebmKQvF1oxzl+tJCkblo3i3kg0c=; b=PYGnw1zoYCiOffuC4JrH/PcPwdpBgHGh 37cIeO8btbJZpsiDauvT/zyhVg5ORlRTvh9s77pOLool0GNJxgv5i2dOEZPbL4B9 BYNkL8P6BwsPB4GxUTursxoc7laqatTTxbYwkW/Yaq4weBSk46mIFUvjvD74C3yV 0sUieh4AShI=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:cc:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=smtpout; bh=ebmKQvF1oxzl+tJCkblo3i3kg0c=; b=ptwp3 VYWUvQix4Vnt8IAxOvQdUDeqIoVIqhm0u9iOuIiUaxymzVNsAMLxcB2cntmsNaXM 6w57jR3uBxU/N03PUYM2dxi+/7L5iPCUR7WKlzJb7fmbkHw7LssPjhEmhiKhUkTj d6KamHBTcVtN04Bh5TQCPxO3N9dWhlyA3iPANE=
X-Sasl-Enc +AqNTdLGCJUhDxHSnIgJ/yUYeLEMVm9wLx3GWqdyDTCL 1377120443
From random832@fastmail.us
To python-list@python.org
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type text/plain
X-Mailer MessagingEngine.com Webmail Interface - ajax-d009844e
Subject Re: Raw_input with readline in a daemon thread makes terminal text disappear
Date Wed, 21 Aug 2013 17:27:23 -0400
In-Reply-To <CE3A5813.9EAC%david.m.welch@gmail.com>
References <CE3A5813.9EAC%david.m.welch@gmail.com>
Cc research@johnohagan.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.108.1377120447.19984.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1377120447 news.xs4all.nl 15934 [2001:888:2000:d::a6]:40247
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52798

Show key headers only | View raw


On Wed, Aug 21, 2013, at 12:42, David M. Welch wrote:
> Hi all, 
> 
> This is an old thread, but I'm having the same behavior in my terminal
> when
> I run some code but kill the process in the terminal (Ctrl-C).  The code
> has
> two prime suspects (from a simple google search):
> 1. Creates ssh port forward via the subprocess module
> (http://unix.stackexchange.com/questions/4740/screen-remote-login-failure-an
> d-disappearing-text)
> 2. Using the getpass module (raw_input?)
> Calling "$ reset" brings back the disappearing text, so I'm just
> wondering
> if this issue has been addressed and if so, what should I be doing that
> I'm
> not.

Do you understand how tty modes (in particular, echo vs non-echo mode)
work?

What you've got is two different pieces of code (I think running
readline in two threads qualifies) fighting over the tty mode, and
probably one of them is turning echo mode off and then either never
restoring it because of how the program exits, or it gets into the
other's idea of the "original" mode.

Why does your program design require input to be handled in a thread
other than the main thread?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Raw_input with readline in a daemon thread makes terminal text disappear random832@fastmail.us - 2013-08-21 17:27 -0400

csiph-web