Skip to content

Commit

Permalink
feat: support inputing spaces in terminal
Browse files Browse the repository at this point in the history
Close #24
  • Loading branch information
luin committed Mar 25, 2016
1 parent 69f2e42 commit 04e7bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/components/main/Main/Database/Content/Terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from 'react';
import commands from 'redis-commands';
import splitargs from 'redis-splitargs';

require('./Terminal.scss');

Expand All @@ -12,13 +13,13 @@ class Terminal extends React.Component {
}

componentDidMount() {
const { redis, style } = this.props;
const { redis } = this.props;
redis.on('select', this.onSelectBinded);
const terminal = this.terminal = $(this.refs.terminal).terminal((command, term) => {
if (!command) {
return;
}
command = command.trim().replace(/\s+/g, ' ').split(' ');
command = splitargs(command);
const commandName = command[0] && command[0].toUpperCase();
if (commandName === 'FLUSHALL' || commandName === 'FLUSHDB') {
term.push(input => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"react-redux": "^4.0.0",
"react-split-pane": "0.1.16",
"redis-commands": "^1.0.1",
"redis-splitargs": "^1.0.0",
"redux": "^3.0.2",
"redux-thunk": "^1.0.0",
"reselect": "^2.0.0",
Expand Down

0 comments on commit 04e7bcf

Please sign in to comment.