Skip to content

Commit 04e7bcf

Browse files
committed
feat: support inputing spaces in terminal
Close luin#24
1 parent 69f2e42 commit 04e7bcf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/components/main/Main/Database/Content/Terminal.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import React from 'react';
44
import commands from 'redis-commands';
5+
import splitargs from 'redis-splitargs';
56

67
require('./Terminal.scss');
78

@@ -12,13 +13,13 @@ class Terminal extends React.Component {
1213
}
1314

1415
componentDidMount() {
15-
const { redis, style } = this.props;
16+
const { redis } = this.props;
1617
redis.on('select', this.onSelectBinded);
1718
const terminal = this.terminal = $(this.refs.terminal).terminal((command, term) => {
1819
if (!command) {
1920
return;
2021
}
21-
command = command.trim().replace(/\s+/g, ' ').split(' ');
22+
command = splitargs(command);
2223
const commandName = command[0] && command[0].toUpperCase();
2324
if (commandName === 'FLUSHALL' || commandName === 'FLUSHDB') {
2425
term.push(input => {

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"react-redux": "^4.0.0",
4242
"react-split-pane": "0.1.16",
4343
"redis-commands": "^1.0.1",
44+
"redis-splitargs": "^1.0.0",
4445
"redux": "^3.0.2",
4546
"redux-thunk": "^1.0.0",
4647
"reselect": "^2.0.0",

0 commit comments

Comments
 (0)