geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ant elder (JIRA)" <>
Subject [jira] Commented: (GERONIMO-3978) Unable to CTRL-C "start-server" process on Windows
Date Mon, 05 Jul 2010 10:53:49 GMT


ant elder commented on GERONIMO-3978:

Coincidentally, I've a similar problem with Tuscany using JLine and ctrl-c not working so
googling for solutions i found this JIRA along with many others trying to fix it with no answers.
So i did some debugging of the JLine code and I think the problem is in the
file shipped inside jline which maps ctrl-c to INSERT with a comment saying "(frankly, I wasn't
sure where to bind this)". That does not seem a great choice as that is what disables the
ctrl-c interupt. It is possible to pass in your own bindings properties file but to do that
has some problems of its own so the simplest solution seemed to be the following code which
resets the ctrl-c binding:

       ConsoleReader reader = ...

        try {
            Field f = ConsoleReader.class.getDeclaredField("keybindings");
            short[] keybindings = (short[])f.get(reader);
            if (keybindings[3] == -48) keybindings[3] = 3;
        } catch (Exception e) {
            e.printStackTrace(); // shouldnt happen

You can then add an ActionListener to do what you want when ctrl-c is pressed, eg:

        reader.addTriggeredAction((char)3, new ActionListener() {
            public void actionPerformed(ActionEvent e) {

> Unable to CTRL-C "start-server" process on Windows
> --------------------------------------------------
>                 Key: GERONIMO-3978
>                 URL:
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>         Environment: Win XP, G Tomcat 2.1
>            Reporter: Vamsavardhana Reddy
>            Assignee: Jason Dillon
> On Windows XP, if I start a Geronimo Tomcat 2.1 server using bin\start-server from a
command prompt, I am noticing that the server can not be shutdown using Control+C.  So, I
am using Admin Console to shutdown the server.  But it does not return to command prompt unless
I kill the java process from Windows Task Manager.
> Jarek says, "As a workaround, you can start gshell with -T false option and then
> control-c worked fine while running the server in foreground."
> See

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message