             # add commands to switch to other kernels
             @kernelManager.getAllKernelSpecsFor language, (kernelSpecs) =>
                 _.pull kernelSpecs, kernel.kernelSpec
-                switchCommands = kernelSpecs.map (spec) ->
+
+                switchCommands = kernelSpecs.map (kernelSpec) =>
                     return {
-                        name: 'Switch to ' + spec.display_name
-                        value: 'switch-kernel'
+                        name: @_getCommandName 'Switch to', kernelSpec
+                        command: 'switch-kernel'
                         grammar: grammar
                         language: language
-                        kernelSpec: spec
+                        kernelSpec: kernelSpec
                     }
 
                 @setItems _.union basicCommands, switchCommands
 
 
+    _getCommandName: (name, kernelSpec) ->
+        return name + ' ' + kernelSpec.display_name + ' kernel'
+
+
     confirmed: (item) ->
         console.log 'Selected command:', item
-        item.command = item.value
         @onConfirmed?(item)
         @cancel()
 

            return @setItems []

        # add basic commands for the current grammar language
        basicCommands = @basicCommands.map (command) ->
            name =
                command.name + ' ' + kernel.kernelSpec.display_name + ' kernel'
            return {
                name: name
                value: command.value
                grammar: grammar
                language: language
                kernel: kernel
            }

        if kernel instanceof WSKernel
            wsKernelCommands = @wsKernelCommands.map (command) ->
                name =
                    command.name + ' ' + kernel.kernelSpec.display_name + ' kernel'
                return {
                    name: name
                    value: command.value
                    grammar: grammar
                    language: language
                    kernel: kernel

        super

        @basicCommands = [
            name: 'Interrupt'
            value: 'interrupt-kernel'
        ,
            name: 'Restart'
            value: 'restart-kernel'
        ,
            name: 'Shut Down'
            value: 'shutdown-kernel'
        ]

        @wsKernelCommands = [
            name: 'Rename session for'
            value: 'rename-kernel'
        ,
            name: 'Disconnect from'
            value: 'disconnect-kernel'
        ]

        @onConfirmed = null
        @list.addClass('mark-active')
        @setItems([])

