Skip to content

Make terminal tab toolbar configurable #194149

Open

Description

  • Show terminal tabs
  • Right click to hide its items isn't supported (Split, Delete)

I would really like to hide split because I never use it and because takes away space on hover - which makes me click it accidentally all the time

Screenshot 2023-09-26 at 16 10 07

Activity

  1. changed the title [-]Make terminal tab action configurable[/-] [+]Make terminal tab toolbar configurable[/+] on Sep 26, 2023
  2. added
    help wanted
    feature-request
    on Sep 26, 2023
  3. added this to the Backlog milestone on Sep 26, 2023
  4. Kalmaegi commented on Sep 27, 2023

    @Kalmaegi
    Contributor

    Daniel Imms (@Tyriar) I'd be willing to fix this if I could

  5. ShiviTripathi13 commented on Sep 27, 2023

    @ShiviTripathi13

    Daniel Imms (@Tyriar) If the issue still open, please assign it to me.

  6. Tyriar commented on Sep 27, 2023

    @Tyriar
    Contributor

    weartist sure you can give it a shot, this is where the actions are added to the bar:

    fillActionBar(instance: ITerminalInstance, template: ITerminalTabEntryTemplate): void {
    // If the instance is within the selection, split all selected
    const actions = [
    new Action(TerminalCommandId.SplitActiveTab, terminalStrings.split.short, ThemeIcon.asClassName(Codicon.splitHorizontal), true, async () => {
    this._runForSelectionOrInstance(instance, async e => {
    this._terminalService.createTerminal({ location: { parentTerminal: e } });
    });
    }),
    new Action(TerminalCommandId.KillActiveTab, terminalStrings.kill.short, ThemeIcon.asClassName(Codicon.trashcan), true, async () => {
    this._runForSelectionOrInstance(instance, e => this._terminalService.safeDisposeTerminal(e));
    })
    ];
    // TODO: Cache these in a way that will use the correct instance
    template.actionBar.clear();
    for (const action of actions) {
    template.actionBar.push(action, { icon: true, label: false, keybinding: this._keybindingService.lookupKeybinding(action.id)?.getLabel() });
    }
    }

    I'm guessing what needs to happen is integrating the tab renderer to use the menu system which will add support for toggling the items.

  7. Kalmaegi commented on Sep 28, 2023

    @Kalmaegi
    Contributor

    weartist sure you can give it a shot, this is where the actions are added to the bar:

    fillActionBar(instance: ITerminalInstance, template: ITerminalTabEntryTemplate): void {
    // If the instance is within the selection, split all selected
    const actions = [
    new Action(TerminalCommandId.SplitActiveTab, terminalStrings.split.short, ThemeIcon.asClassName(Codicon.splitHorizontal), true, async () => {
    this._runForSelectionOrInstance(instance, async e => {
    this._terminalService.createTerminal({ location: { parentTerminal: e } });
    });
    }),
    new Action(TerminalCommandId.KillActiveTab, terminalStrings.kill.short, ThemeIcon.asClassName(Codicon.trashcan), true, async () => {
    this._runForSelectionOrInstance(instance, e => this._terminalService.safeDisposeTerminal(e));
    })
    ];
    // TODO: Cache these in a way that will use the correct instance
    template.actionBar.clear();
    for (const action of actions) {
    template.actionBar.push(action, { icon: true, label: false, keybinding: this._keybindingService.lookupKeybinding(action.id)?.getLabel() });
    }
    }

    I'm guessing what needs to happen is integrating the tab renderer to use the menu system which will add support for toggling the items.

    Thanks for the tip~ I'll give it a try

  8. jrieken commented on Sep 28, 2023

    @jrieken
    ContributorAuthor

    weartist You can use WorkbenchToolBar or MenuWorkbenchToolBar to get a menu that support hiding etc. However, they only support menu items, meaning those commands need to be migrated to use registerAction2

  9. Kalmaegi commented on Oct 3, 2023

    @Kalmaegi
    Contributor

    weartist You can use WorkbenchToolBar or MenuWorkbenchToolBar to get a menu that support hiding etc. However, they only support menu items, meaning those commands need to be migrated to use registerAction2

    Thank you very much for your help! Fantastic, but I'm on my way right now and I'll start this work in three days, hopefully it goes well

  10. Kalmaegi commented on Oct 3, 2023

    @Kalmaegi
    Contributor

    Johannes Rieken (@jrieken) Daniel Imms (@Tyriar) I wanted to ask a simple question to clarify what needed to be done: what we wanted to do was to make each tab of multiple terminals configurable to display right, and I found that when there is only one terminal, the tab in the upper section is configurable
    What needs to be modified:
    image

    image

    Already supported, does not need to be modified:
    image

  11. Kalmaegi commented on Oct 9, 2023

    @Kalmaegi
    Contributor

    Sorry I'm late, start working on this today

  12. Kalmaegi commented on Oct 10, 2023

    @Kalmaegi
    Contributor

    Briefly added a menu bar, I'll submit a PR later:
    image

  13. Kalmaegi commented on Oct 26, 2023

    @Kalmaegi
    Contributor

    Because something is delaying the change, I'm going to replace the ActionBar currently used by terminalTabsList with the WorkbenchToolBar, and adjust the current two actions to MenuItemAction

  14. Kalmaegi commented on Nov 8, 2023

    @Kalmaegi
    Contributor

    Daniel Imms (@Tyriar) Johannes Rieken (@jrieken) I'm sorry, I may not be able to complete this task, I'm a little confused about registerAction2 and using MenuItemAction, and I don't know how to use these two actions in the WorkbenchToolBar,I'm sorry for the time I've been delayed in this issue

  15. DatN99 commented on May 5, 2024

    @DatN99
    Contributor

    weartist If you're no longer working on this, I'd love to give this a shot! I'm a first time contributor, but I'm hoping I can tackle this issue

  16. Tyriar commented on Sep 23, 2024

    @Tyriar
    Contributor

    For future contributors, the search view does what we want here so that will be a good reference:

    Image

  17. removed their assignment
    on Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requesthelp wantedterminal-tabs

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions