Command doesn't show up in the palette


#1

Hi, new to Atom here! I’ve tried adding a command,

{View} = require 'atom-space-pen-views'

class TerminalPlusView extends View
  initialize: (@id, @pwd, @statusIcon, @statusBar, @shell, @args=[]) ->
    console.log ' ---- adding command to this element:'
    atom.commands.add @,
      'terminal-plus:fullscreen': (event) ->
        console.log ' ------- hello command.'

but I don’t see it in the palette after an instance of that class has been instantiated. I also tried doing it globally,

{View} = require 'atom-space-pen-views'

class TerminalPlusView extends View
  initialize: (@id, @pwd, @statusIcon, @statusBar, @shell, @args=[]) ->
    # ...
    
console.log ' ---- adding command globally.'
atom.commands.add '.terminal-plus.terminal-view',
  'terminal-plus:fullscreen': (event) ->
    console.log ' ------- hello command.'

but that doesn’t work either. I can’t find the command in the palette:

What am I missing?


#2

A command will only show up in the Command Palette if it is applicable to the context of where the focus is. From the screenshot, it appears that the focus is on a regular text editor view, not a .terminal-plus.terminal-view where the command is applicable.