Menu

#159 Console: Multiple tabs for system shell

None
open
None
5
2016-06-08
2009-12-17
Dale Anson
No

It would be nice to be able to have more than one system shell open at a time in the Console plugin, maybe a multiple tab interface would work.

Discussion

  • Alan Ezust

    Alan Ezust - 2010-01-18

    Funny, that was one of the first things I thought about adding to it, and Slava told me not to, since we can create multiple separate floating instances. But that's not the same, really?

    Then I thought, oh wait, mydoggy lets you share tabs between dockables. What if you create "new floating instances" and bring them togehter in tabs, can achieve the same thing?

    But it seems MyDoggy does not allow "new floating instances".

    If MyDoggy allowed "new floating instance" then you could get multiple console tabs for any shell.

     
  • Alan Ezust

    Alan Ezust - 2012-06-07

    To whoever volunteers to do this:
    please don't use the built-in JTabbedPane though, it wastes vertical space.

    It might be better to just add a "+" button that creates another shell switcher combobox (perhaps in a small panel) all in the same horizontal layout that has the current shell switcher combobox.

    Then the comboboxes can be used as the tab buttons.

     
  • Dale Anson

    Dale Anson - 2016-05-30
    • assigned_to: Dale Anson
    • Group: -->
     
  • Dale Anson

    Dale Anson - 2016-05-30

    First draft is checked in at revision 24398. It's not quite done, I need to put some strings into the properties file, but I think the rest is working pretty well.

     
  • Dale Anson

    Dale Anson - 2016-06-04

    I've checked in a new version at revision 24401. This removes the dependency on the latest version of jEdit code, but now has a dependency on the latest CommonControls 1.7.5 code. This seems to be working well, but there is still some code clean up to be done before it can be released.

     
  • Alan Ezust

    Alan Ezust - 2016-06-05

    A couple of comments.

    1. additional buttons to represent the tabs to the right of the combobox? I don't see anything resembling tabs now.

    2. why only system and beanshell and not the other plugin-provided shells?

     

    Last edit: Alan Ezust 2016-06-05
  • Dale Anson

    Dale Anson - 2016-06-06

    For 1, the existing drop down seems sufficient. For 2, those are the only two that  i know the code to create. Service manager does not expose the details of shells provided by other plugins. Some adjustment to service manager would allow discovery of those other shells like ssh

     
  • Alan Ezust

    Alan Ezust - 2016-06-06

    I have my default shell set to System. I have no user shells at all. And yet, the shell keeps switching to Beanshell now, when it did not before your recent changes.

     
  • Dale Anson

    Dale Anson - 2016-06-07

    I'm back in town tomorrow I'll ake look then.

     
  • Alan Ezust

    Alan Ezust - 2016-06-07

    It seems to happen at least once after each jEdit startup. I open a new Console window and it indicates System is active.
    The first command I enter is parsed by Beanshell, and then it switches to beanshell right after that.

     
  • Dale Anson

    Dale Anson - 2016-06-07

    Okay, I see that. A question, though, there are two properties, one for the default shell as set in the options, and one for the last used shell. When Console starts, I'm assuming the dropdown should be set to the last used shell if it is set in the property, the default shell otherwise. Does that sound right?

    Also, about ServiceManager, to register a service, ServiceManager needs a class name, a name for the service, and the beanshell code that creates the service, in other words, all the info provided in the services.xml file. For Console to create a new service of an existing shell type, like ssh, for example, then Console also needs that info to pass to ServiceManger. The classname and service name are not a problem, but I don't know where to get the beanshell code. ServiceManager has it, but doesn't provide any way to share it outside of itself. Any ideas? I could use a crappy hack like the Beauty plugin does to reset the indent rules in Mode.java, but I'm always a little hesitant to do that.

     
    • Alan Ezust

      Alan Ezust - 2016-06-07

      On Tue, Jun 7, 2016 at 4:13 PM, Dale Anson daleanson@users.sf.net wrote:

      Okay, I see that. A question, though, there are two properties, one for
      the default shell as set in the options, and one for the last used shell.
      When Console starts, I'm assuming the dropdown should be set to the last
      used shell if it is set in the property, the default shell otherwise. Does
      that sound right?

      Yes.

      Also, about ServiceManager, to register a service, ServiceManager needs a
      class name, a name for the service, and the beanshell code that creates the
      service, in other words, all the info provided in the services.xml file.
      For Console to create a new service of an existing shell type, like ssh,
      for example, then Console also needs that info to pass to ServiceManger.
      The classname and service name are not a problem, but I don't know where to
      get the beanshell code. ServiceManager has it, but doesn't provide any way
      to share it outside of itself. Any ideas? I could use a crappy hack like
      the Beauty plugin does to reset the indent rules in Mode.java, but I'm
      always a little hesitant to do that.

      Do you need the code, or the service object? why not just call
      "ServiceManager.getService()" which returns the object. Then you don't need
      the code.

      public static Object getService(String clazz, String name)
      
       
      • Dale Anson

        Dale Anson - 2016-06-08

        No, the code is necessary. The getService method doesn't return a new shell, it returns an existing shell, so if I call getService("console.Shell", "System", I get the already existing System shell. To create a new system shell (or BeanShell shell or whatever), it's necessary to have the code and call registerService("console.Shell", name, "new console.SystemShell(name)", null); This creates a new System shell with a different name, then it can run different commands.

         
  • Alan Ezust

    Alan Ezust - 2016-06-08

    Let me qualify the answer to your first question:
    In plugin options Console General - "Default Shell", you can select default shell, and in that combo, you can choose "last selected".
    "Last Used" shell property is only used if last selected is chosen in that plugin options combobox.

     

    Last edit: Alan Ezust 2016-06-08

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.