Allow plugins to set the parent/predecessor of a new session (#3723)
This commit is contained in:
parent
6deb733d63
commit
71953e0fdf
6 changed files with 22 additions and 19 deletions
|
|
@ -17,7 +17,7 @@ import {
|
|||
SESSION_SEARCH_CLOSE
|
||||
} from '../constants/sessions';
|
||||
|
||||
export function addSession({uid, shell, pid, cols, rows, splitDirection}) {
|
||||
export function addSession({uid, shell, pid, cols, rows, splitDirection, activeUid}) {
|
||||
return (dispatch, getState) => {
|
||||
const {sessions} = getState();
|
||||
const now = Date.now();
|
||||
|
|
@ -29,7 +29,7 @@ export function addSession({uid, shell, pid, cols, rows, splitDirection}) {
|
|||
cols,
|
||||
rows,
|
||||
splitDirection,
|
||||
activeUid: sessions.activeUid,
|
||||
activeUid: activeUid ? activeUid : sessions.activeUid,
|
||||
now
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,14 +12,15 @@ import getRootGroups from '../selectors';
|
|||
import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
|
||||
|
||||
function requestSplit(direction) {
|
||||
return () => (dispatch, getState) => {
|
||||
return activeUid => (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: SESSION_REQUEST,
|
||||
effect: () => {
|
||||
const {ui} = getState();
|
||||
const {ui, sessions} = getState();
|
||||
rpc.emit('new', {
|
||||
splitDirection: direction,
|
||||
cwd: ui.cwd
|
||||
cwd: ui.cwd,
|
||||
activeUid: activeUid ? activeUid : sessions.activeUid
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -37,7 +38,7 @@ export function resizeTermGroup(uid, sizes) {
|
|||
};
|
||||
}
|
||||
|
||||
export function requestTermGroup() {
|
||||
export function requestTermGroup(activeUid) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: TERM_GROUP_REQUEST,
|
||||
|
|
@ -46,7 +47,8 @@ export function requestTermGroup() {
|
|||
const {cwd} = ui;
|
||||
rpc.emit('new', {
|
||||
isNewGroup: true,
|
||||
cwd
|
||||
cwd,
|
||||
activeUid
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue