mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Make SESSION_REQUEST/TERM_GROUP_REQUEST hackable (#2777)
`cwd` should be lazy evaluated to let plugins override it
This commit is contained in:
parent
dc33d4846b
commit
f6a1ba114a
2 changed files with 5 additions and 5 deletions
|
|
@ -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});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue