diff --git a/.gitignore b/.gitignore index d92be03d..b5ec510d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ yarn-error.log .hyper.js .hyper_plugins +.DS_Store diff --git a/lib/actions/sessions.js b/lib/actions/sessions.js index b48b9165..42f96732 100644 --- a/lib/actions/sessions.js +++ b/lib/actions/sessions.js @@ -1,5 +1,4 @@ import rpc from '../rpc'; -import isUrl from '../utils/url-command'; import {keys} from '../utils/object'; import findBySession from '../utils/term-groups'; import { @@ -13,8 +12,6 @@ import { SESSION_SET_ACTIVE, SESSION_CLEAR_ACTIVE, SESSION_USER_DATA, - SESSION_URL_SET, - SESSION_URL_UNSET, SESSION_SET_XTERM_TITLE } from '../constants/sessions'; @@ -50,24 +47,12 @@ export function requestSession() { } export function addSessionData(uid, data) { - return (dispatch, getState) => { + return dispatch => { dispatch({ type: SESSION_ADD_DATA, data, effect() { - const session = getState().sessions.sessions[uid]; const now = Date.now(); - if (session) { - const enterKey = data.indexOf('\n') > 0; - const url = enterKey ? isUrl(session.shell, data) : null; - if (url) { - return dispatch({ - type: SESSION_URL_SET, - uid, - url - }); - } - } dispatch({ type: SESSION_PTY_DATA, uid, @@ -160,10 +145,3 @@ export function sendSessionData(uid, data, escaped) { }); }; } - -export function exitSessionBrowser(uid) { - return { - type: SESSION_URL_UNSET, - uid - }; -} diff --git a/lib/reducers/sessions.js b/lib/reducers/sessions.js index d012dcb7..508899c9 100644 --- a/lib/reducers/sessions.js +++ b/lib/reducers/sessions.js @@ -7,8 +7,6 @@ import { SESSION_PTY_DATA, SESSION_SET_ACTIVE, SESSION_CLEAR_ACTIVE, - SESSION_URL_SET, - SESSION_URL_UNSET, SESSION_RESIZE, SESSION_SET_XTERM_TITLE, SESSION_SET_CWD @@ -46,12 +44,6 @@ const reducer = (state = initialState, action) => { }) ); - case SESSION_URL_SET: - return state.setIn(['sessions', action.uid, 'url'], action.url); - - case SESSION_URL_UNSET: - return state.setIn(['sessions', action.uid, 'url'], null); - case SESSION_SET_ACTIVE: return state.set('activeUid', action.uid); diff --git a/lib/utils/url-command.js b/lib/utils/url-command.js deleted file mode 100644 index 2492783c..00000000 --- a/lib/utils/url-command.js +++ /dev/null @@ -1,18 +0,0 @@ -import path from 'path'; -import * as regex from './url-regex'; - -export default function isUrlCommand(shell, data) { - const matcher = regex[path.parse(shell).name]; - if (undefined === matcher || !data) { - return null; - } - - const match = data.match(matcher); - const urlRegex = /((?:https?:\/\/)(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)/; - - if (match && urlRegex.test(match[2])) { - return `${match[2]}`; - } - - return null; -} diff --git a/lib/utils/url-regex.js b/lib/utils/url-regex.js deleted file mode 100644 index 0823b309..00000000 --- a/lib/utils/url-regex.js +++ /dev/null @@ -1,4 +0,0 @@ -export const sh = /(?:ba)?sh: ((?:file:\/\/)|(?:\/\/))?(.*): (?:(?:command not found)|(?:No such file or directory))/; -export const bash = sh; -export const zsh = /zsh: (?:(?:command not found)|(?:no such file or directory)): ((?:file:\/\/)|(?:\/\/))?([^\n]+)/; -export const fish = /fish: Unknown command '((?:file:\/\/)|(?:\/\/))?([^']+)'/;