Skip to content

Commit 1939b21

Browse files
Jün YannesJün Yannes
Jün Yannes
authored and
Jün Yannes
committed
moved adding of input to log out of output function
1 parent 986aaa2 commit 1939b21

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-web-terminal",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "A web-based terminal facade built on reactjs",
55
"repository": {
66
"type": "git",

src/components/react-web-terminal/react-web-terminal.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class WebTerminal extends React.Component {
1414
this.state = {
1515
log: [],
1616
logId: 0,
17-
commandHandler: props.commandHandler ? props.commandHandler : (component) => { component.output(component.input()) },
17+
commandHandler: props.commandHandler ? props.commandHandler : component => component.output(component.input()),
1818
keyStrokeMap: props.keyStrokeMap || {},
1919
style: {
2020
reactWebTerminal: {},
@@ -46,8 +46,6 @@ export default class WebTerminal extends React.Component {
4646
}
4747

4848
output(output) {
49-
this.addToLog(this.inputComp.state.prompt + this.input(), 'react-web-terminal-input');
50-
5149
this.addToLog(output, 'react-web-terminal-output');
5250

5351
this.resetInputBuffer();
@@ -68,6 +66,7 @@ export default class WebTerminal extends React.Component {
6866
}
6967

7068
onCommandEntered() {
69+
this.addToLog(this.inputComp.state.prompt + this.input(), 'react-web-terminal-input');
7170
this.state.commandHandler(this);
7271
}
7372

0 commit comments

Comments
 (0)