mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 05:38: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() {
|
export function requestSession() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const {ui} = getState();
|
|
||||||
const {cols, rows, cwd} = ui;
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: SESSION_REQUEST,
|
type: SESSION_REQUEST,
|
||||||
effect: () => {
|
effect: () => {
|
||||||
|
const {ui} = getState();
|
||||||
|
const {cols, rows, cwd} = ui;
|
||||||
rpc.emit('new', {cols, rows, cwd});
|
rpc.emit('new', {cols, rows, cwd});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
|
||||||
|
|
||||||
function requestSplit(direction) {
|
function requestSplit(direction) {
|
||||||
return () => (dispatch, getState) => {
|
return () => (dispatch, getState) => {
|
||||||
const {ui} = getState();
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: SESSION_REQUEST,
|
type: SESSION_REQUEST,
|
||||||
effect: () => {
|
effect: () => {
|
||||||
|
const {ui} = getState();
|
||||||
rpc.emit('new', {
|
rpc.emit('new', {
|
||||||
splitDirection: direction,
|
splitDirection: direction,
|
||||||
cwd: ui.cwd
|
cwd: ui.cwd
|
||||||
|
|
@ -39,11 +39,11 @@ export function resizeTermGroup(uid, sizes) {
|
||||||
|
|
||||||
export function requestTermGroup() {
|
export function requestTermGroup() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const {ui} = getState();
|
|
||||||
const {cols, rows, cwd} = ui;
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: TERM_GROUP_REQUEST,
|
type: TERM_GROUP_REQUEST,
|
||||||
effect: () => {
|
effect: () => {
|
||||||
|
const {ui} = getState();
|
||||||
|
const {cols, rows, cwd} = ui;
|
||||||
rpc.emit('new', {
|
rpc.emit('new', {
|
||||||
isNewGroup: true,
|
isNewGroup: true,
|
||||||
cols,
|
cols,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue