Terminal Current
This section is about the current functionality of the Terminal.
The current terminal is the last terminal that has been focused. It does not correspond with the focus because the focus can be on another part of the application and there would still be a current terminal (even if it does not have the focus). The current terminal changes when a new terminal is focused.
getCurrentTerminalId
Returns the id of the current terminal.
Copy
getCurrentTerminalId(state: Object): String;
-
state Object
Required. The global state of the application.
Returns
String
The ID of the new current terminal.
Example
Copy
const state = storeHelper.getState();
const getCurrentTerminalId = selectorsHelper.make('getCurrentTerminalId');
const currentTerminalId = getCurrentTerminalId(state);
replaceCurrentTerminalId
Changes the current terminal.
Note: Dispatches an action with the type @orion/terminals-helper/REPLACE_CURRENT_TERMINAL_ID which can be handled.
Usage
Copy
dispatchersHelper.dispatch('replaceCurrentTerminalId', { terminalId: String });
-
terminalId String
Required. The ID of the new current terminal.
Example
Copy
dispatchersHelper.dispatch('replaceCurrentTerminalId', {
terminalId: 'terminal-1',
});