'Ipython notebook handle async commands

I am working on a Jupyter notebook to customize its custom.js So I created a toolbar button which runs a Bash command (for example : git pull) It works well, like this :

if($(IPython.toolbar.selector.concat(' > #pull-repo')).length == 0){ IPython.toolbar.add_buttons_group([
    {
         'label'   : 'pull repository',
         'icon'    : 'fa fa-angle-double-down',
         'callback': function(){
             code_input = "!git pull"
             var kernel = IPython.notebook.kernel;
             var msg_id = kernel.execute(code_input);

         }
    }
], 'pull-repo'); }

The problem is, I want to notify the user when the execution is done (with and alert("msg") or ..) Would this be possible ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source