Make SESSION_REQUEST/TERM_GROUP_REQUEST hackable (#2777)

`cwd` should be lazy evaluated to let plugins override it
This commit is contained in:
CHaBou 2018-03-21 12:40:56 +01:00 committed by Albin Ekblom
parent dc33d4846b
commit f6a1ba114a
2 changed files with 5 additions and 5 deletions

View file

@ -38,11 +38,11 @@ export function addSession({uid, shell, pid, cols, rows, splitDirection}) {
export function requestSession() {
return (dispatch, getState) => {
const {ui} = getState();
const {cols, rows, cwd} = ui;
dispatch({
type: SESSION_REQUEST,
effect: () => {
const {ui} = getState();
const {cols, rows, cwd} = ui;
rpc.emit('new', {cols, rows, cwd});
}
});

View file

@ -13,10 +13,10 @@ import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
function requestSplit(direction) {
return () => (dispatch, getState) => {
const {ui} = getState();
dispatch({
type: SESSION_REQUEST,
effect: () => {
const {ui} = getState();
rpc.emit('new', {
splitDirection: direction,
cwd: ui.cwd
@ -39,11 +39,11 @@ export function resizeTermGroup(uid, sizes) {
export function requestTermGroup() {
return (dispatch, getState) => {
const {ui} = getState();
const {cols, rows, cwd} = ui;
dispatch({
type: TERM_GROUP_REQUEST,
effect: () => {
const {ui} = getState();
const {cols, rows, cwd} = ui;
rpc.emit('new', {
isNewGroup: true,
cols,