Ctrl-C problem in ZSH + workaround

711 views
Skip to first unread message

Cezary

unread,
Mar 15, 2011, 4:44:26 PM3/15/11
to rubyversi...@googlegroups.com
After an upgrade Ctl-C stopped working in ZSH. The workaround is
calling:

$ rvm reload

So, the following in my zsh rc scripts make the problem run away:

if [[ -s /home/me/.rvm/scripts/rvm ]] ; then
source /home/me/.rvm/scripts/rvm ;
rvm reload
fi

I did a bisect and unfortunately the commit that introduces the
problem is ... well, too big for my little brain.

commit 2bc17e8f593b2ab35f0939b5e3a0051a26683f81
Author: Wayne E. Seguin <waynee...@gmail.com>
Date: Mon Feb 28 13:13:14 2011 -0500

Reorganization and cleanup. scripts/utility => scripts/functions/*

I might try to extract the actual changes from the commit and debug
that if I find some more time.

Info:

ZSH version:
zsh 4.3.10-dev-1-cvs (x86_64-unknown-linux-gnu)

RVM version (with workaround):
master 94931a4 [origin/master] Added rbx-1.2.3

I'll be glad to test, OTOH. Especially since I may have some very rare
ZSH options turned on.

Thanks!

Cezary

--
Cezary Baginski

signature.asc

Wayne E. Seguin

unread,
Mar 16, 2011, 9:43:31 PM3/16/11
to rubyversi...@googlegroups.com
Does this happen on the latest git head?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk1/z5sACgkQgEYXSknSpI9w2wCggB4C8OWgbKlkmXxZyY2bKkaV
MGsAoIWnxaBtP1E09RMjf+yaD6lneFWh
=LkH0
-----END PGP SIGNATURE-----




--
  ~Wayne

Wayne E. Seguin
wayneeseguin on irc.freenode.net

Cezary

unread,
Mar 17, 2011, 2:19:33 AM3/17/11
to rubyversi...@googlegroups.com
On Wed, Mar 16, 2011 at 09:43:31PM -0400, Wayne E. Seguin wrote:
> Does this happen on the latest git head?

I spent some time debugging and:

Solution:
=========
Logout completely and login.


Details:
========
rvm_interactive_flag was somehow set to 0 in the login shell.
This cause the base script to load as non-interactive, setting up
rvm_cleanup_tmp with trap, which "trapped" every Control-C.

rvm reload OTOH set the flag correctly for the session, disabling the
Control-C signal handling.

The old commit worked, because it didn't handle cleanup the same way.


Other (arrays):
===============

In Zsh, there is a KSH_ARRAYS param. Probably rarely used, but among
other things, makes Zsh arrays start at 0. Might be used to simplify or
difficultify the array handling in RVM.

Thanks,

Cezary

--
Cezary Baginski

signature.asc

Cezary

unread,
Mar 17, 2011, 4:16:17 PM3/17/11
to rubyversi...@googlegroups.com
On Thu, Mar 17, 2011 at 07:19:33AM +0100, Cezary wrote:

Reply to myself.

> Solution:
> =========
> Logout completely and login.

I take that back. At some point the problem returns.

Turns out that sometimes the rvm_interactive_flag is exported as
"0", and then new sessions run in "non-interactive" mode, i.e.
trapping Ctrl-C again.

A workaround would of course be:

if [[ -s /home/trzareq/.rvm/scripts/rvm ]] ; then

# NOTE: force the flag to always be 1 instead of 0 sometimes
export rvm_interactive_flag=1

source /home/trzareq/.rvm/scripts/rvm ;
fi

But I'll try to reproduce and nail this problem.

The variable is exported a few times during an interactive session
(e.g. in binscripts/rvm with "0") - shouldn't it be unexported, so
that interactive session can be detected?

In the meantime, I would appreciate any ideas on how I can reproduce
this.

Regards,
Cezary

--
Cezary Baginski

signature.asc

Wayne Seguin

unread,
Mar 17, 2011, 6:07:40 PM3/17/11
to rubyversi...@googlegroups.com
Cezary,

Please get head and try now.

~Wayne

Cezary

unread,
Mar 18, 2011, 4:35:38 PM3/18/11
to rubyversi...@googlegroups.com
On Thu, Mar 17, 2011 at 06:07:40PM -0400, Wayne Seguin wrote:
>
> Please get head and try now.

Works great! Thanks Wayne - your awesome :)

--
Cezary Baginski

signature.asc
Reply all
Reply to author
Forward
0 new messages