[asterisk-bugs] [Asterisk 0013464]: asterisk console screws up terminal subtly when exited with ctrl-c with some shells

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Dec 11 17:36:15 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13464 
====================================================================== 
Reported By:                tzafrir
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   13464
Category:                   Core/General
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 142359 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-11 11:18 CDT
Last Modified:              2008-12-11 17:36 CST
====================================================================== 
Summary:                    asterisk console screws up terminal subtly when
exited with ctrl-c with some shells
Description: 
Symptom:

# asterisk -r
[...]
wall*CLI>
*** CTRL-C pressed here ***
#
*** CTRL-D pressed here***
zsh: do you wish to see all 1670 possibilities (835 lines)? n


This seems to be triggered by the combination of zsh
and asterisk. It is cleared by issuing 'stty sane'.

I tried comparing the output of 'stty -a' at the following:

1. Clear start ("sane")
2. Starting Asterisk from zsh and pressing ctrl-C ("zshbad")
3. Starting Asterisk from bash and pressing ctrl-C ("bashbad").

No noticable differences between "sane" and "bashbad". The differences
between "sane" and "zshbad" are:

	sane	zshbad
	----    ------
eof     ^D      <undef>	
rprnt   ^R      <undef>
werase  ^W      <undef>	
lnext   ^V      <undef>
      -inlcr    inlcr
      iexten	-iexten
      echok     -echok

Tested with recent trunk (r142359) and the following shells on a Debian
Lenny system:

bash                  3.2-4
busybox-static        1:1.10.2-1
dash                  0.5.4-11
posh                  0.6.13
zsh                   4.3.6-6

posh and bash work well. zsh, dash and busybox ash mis-behave: leave
'eof' undefined. With dash and busybox ash, after pressing ctrl-C you
can no longer write to the terminal (until a 'clear' or 'stty sane')


Workaround: run 'stty sane' on the affected shells after such a ctrl-C.
====================================================================== 

---------------------------------------------------------------------- 
 (0096294) svnbot (reporter) - 2008-12-11 17:36
 http://bugs.digium.com/view.php?id=13464#c96294 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 163383

U   branches/1.4/main/asterisk.c

------------------------------------------------------------------------
r163383 | tilghman | 2008-12-11 17:36:14 -0600 (Thu, 11 Dec 2008) | 9
lines

When a Ctrl-C or Ctrl-D ends a remote console, on certain shells, the
terminal
is messed up.  By intercepting those events with a signal handler in the
remote
console, we can avoid those issues.
(closes issue http://bugs.digium.com/view.php?id=13464)
 Reported by: tzafrir
 Patches: 
       20081110__bug13464.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=163383 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-12-11 17:36 svnbot         Checkin                                      
2008-12-11 17:36 svnbot         Note Added: 0096294                          
======================================================================




More information about the asterisk-bugs mailing list