Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to completely remove the Terminal? #5663

Closed
rubenanapu opened this issue Jul 8, 2019 · 9 comments
Closed

How to completely remove the Terminal? #5663

rubenanapu opened this issue Jul 8, 2019 · 9 comments
Labels
question user / developer questions terminal issues related to the terminal

Comments

@rubenanapu
Copy link

Description

I use Theia on Docker and I want to hide that Terminal menu. I'm only interested in the Code Editor, not on the shell.

In theory, I could only remove "@theia/terminal" from examples/browser/package.json, but that doesn't work.

OS and Theia version:
Theia 0.8.0
OS: Linux Ubuntu 18.04.2 LTS

@akosyakov
Copy link
Member

akosyakov commented Jul 8, 2019

In theory, I could only remove "@theia/terminal" from examples/browser/package.json, but that doesn't work.

Can you elaborate? Maybe another extension pulls the terminal extension transitively? Please run yarn why @theia/terminal and remove all extensions which pull it.

@akosyakov akosyakov added question user / developer questions terminal issues related to the terminal labels Jul 8, 2019
@kittaakos
Copy link
Contributor

@rubenanapu
Copy link
Author

I'm not using @theia/debug @kittaakos, but thanks for the answer.

@akosyakov, with yarn why @theia/terminal I found which package uses it. It's used by @theia/task that is inherited by @theia/cpp:

The thing is that I don't want to drop @theia/cpp support.

I'll dive deeper into @theia/terminal to see how to disable the browser directly there.

Thanks guys.

I'll let you know in case I manage to remove it from the browser.

@rubenanapu
Copy link
Author

Guys, if I can't easily remove the @theia/terminal because I need @theia/cpp, does anybody know how to just hide the Terminal menu from the web browser?

@akosyakov
Copy link
Member

You could try to create a custom extension which rebinds terminal contribution and makes it no-op.

@datou0412
Copy link
Contributor

const menu = this.menuModelRegistry.getMenu(MAIN_MENU_BAR);
menu.removeNode('7_terminal'); // remove the whole submenu, wont work

const menu = this.menuModelRegistry.getMenu(TerminalMenus.TERMINAL_NEW);
menu.removeNode(TerminalCommands.NEW.id); // remove one submenu child, it works

Is this a bug? @akosyakov

@datou0412
Copy link
Contributor

You could try to create a custom extension which rebinds terminal contribution and makes it no-op.

rebind TerminalFrontendContribution, and rebind TaskFrontendContribution as well

extends the registerMenus method to noop
registerMenus(): void {}

as well as registerCommands , if u want to disabled the command

@akosyakov
Copy link
Member

@datou0412 A new menu generated each time when you call getMenu. You need to call unregister to remove terminal menus from the registry at all

@JonasHelming
Copy link
Contributor

This might be a good solution for this issue, too:
#9069

@eclipse-theia eclipse-theia locked and limited conversation to collaborators Mar 12, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question user / developer questions terminal issues related to the terminal
Projects
None yet
Development

No branches or pull requests

5 participants