1- import { EOL } from 'os' ;
2-
3- import { remote } from 'electron' ;
41import * as shellEscape from 'php-escape-shell' ;
52import last from '../utils/array' ;
63import isExecutable from '../utils/file' ;
@@ -24,7 +21,6 @@ import {
2421 UI_MOVE_TO ,
2522 UI_MOVE_NEXT_PANE ,
2623 UI_MOVE_PREV_PANE ,
27- UI_SHOW_PREFERENCES ,
2824 UI_WINDOW_GEOMETRY_CHANGED ,
2925 UI_WINDOW_MOVE ,
3026 UI_OPEN_FILE
@@ -210,52 +206,6 @@ export function moveTo(i) {
210206 } ;
211207}
212208
213- function getEditCommand ( shell , isWin ) {
214- if ( isWin && shell . includes ( 'bash' ) ) {
215- return [
216- ' echo Attempting to open .hyper.js with nano' ,
217- ' nano .hyper.js'
218- ] ;
219- } else if ( isWin ) {
220- return [
221- ' echo Attempting to open .hyper.js with notepad' ,
222- ' start notepad "%userprofile%\\.hyper.js"'
223- ] ;
224- }
225- return [
226- ' echo Attempting to open ~/.hyper.js with your \\$EDITOR' ,
227- // eslint-disable-next-line no-template-curly-in-string
228- ' bash -c \'exec env ${EDITOR:=nano} ~/.hyper.js\''
229- ] ;
230- }
231-
232- export function showPreferences ( ) {
233- const plugins = remote . require ( './plugins' ) ;
234- const { shell} = plugins . getDecoratedConfig ( ) ;
235- const message = getEditCommand ( shell , process . platform === 'win32' ) ;
236-
237- return dispatch => {
238- dispatch ( {
239- type : UI_SHOW_PREFERENCES ,
240- effect ( ) {
241- dispatch ( requestSession ( ) ) ;
242- // Replace this hack with an async action
243- rpc . once ( 'session add' , ( { uid} ) => {
244- rpc . once ( 'session data' , ( ) => {
245- dispatch ( sendSessionData (
246- uid ,
247- [
248- ...message ,
249- ''
250- ] . join ( EOL )
251- ) ) ;
252- } ) ;
253- } ) ;
254- }
255- } ) ;
256- } ;
257- }
258-
259209export function windowMove ( ) {
260210 return dispatch => {
261211 dispatch ( {
0 commit comments