This was originally reported here:
https://github.com/rapid7/meterpreter/issues/113
But I was instructed to also file a ticket under framework, because it appears to be related to Ruby 2.x, although at this point we're still trying to understand the problem.
Basically, if you are on Ruby 2.x and you try to background your shell repeatedly, you can cause a backtrace and then meterpreter will go bad (as in you won't be able to interact with it anymore). If you're on Ruby 1.9 you won't get the same thing.
Signal handling across multiple threads has been buggy in Ruby for a long time (broken on OS X on multiple occasions). Hijacking this ticket to work on a replacement for the ^C and ^Z handlers.
The proposed changes:
C:\> ^C
[*] Type ~kill to terminate the channel or session or ~background to detach
Anyone have a preference on the magic command prefix character(s)? I like ~ because its unlikely to conflict with Unix shell sessions (~kill/~background) compared to something like !.
cc @jlee-r7 @trosen-r7 @limhoff-r7
How about: ≈ ;-) (it's just Option-X on OSX)
Great idea! Any time the console receives ≈, it will download the Ubuntu ISO and fix the issue =)
Tilde isn't great and ^[ is likely to have similar issues. Any thoughts on a double sequence like !!quit?
Is #6864 and adequate solution here? Seems we got a little sidetracked on some details.
I honestly did not know enough when https://github.com/rapid7/meterpreter/issues/113 was filed to address it, but I think this should do the trick.