Comments (5)
That is definitely odd. Could you show me the code you're using to fetch the data and sending it to the terminal?
from react-console-emulator.
Sure! Here is the whole thing
commands = {
python: {
fn: (arg1) => {
const terminal = this.terminal.current
if (arg1 === undefined) {
return "Sorry, we don't support running python directly in the browser.\n" +
"At any given point, you can only run the script of the file you're working on."
}
if (arg1 !== this.props.problemTitle) {
return `File "${arg1}" non found.\n`
}
// send api request
const code = this.props.code
const problemId = this.props.problemId
axios({
method: 'get',
url: `${URI}api/run/${problemId}`,
params: {
code
}
}).then((response) => {
console.log(response.data)
terminal.pushToStdout(response.data.output)
}).catch((error) => {
console.log(error)
});
return ""
}
}
}
If you're wondering what's in the response.data
, it's this:
{ output: "hello world\nhello world\nhello world\n" }
from react-console-emulator.
Hi, thanks for the report, I'll be investigating this in detail ASAP.
from react-console-emulator.
Doesn't work for me either :(
from react-console-emulator.
Fixed in 12110e8. Will be pushed out with the next version.
from react-console-emulator.
Related Issues (20)
- Make a maxOutput prop? HOT 1
- Live demo leads to a 404 page HOT 5
- Duplicate welcomeMessage HOT 2
- Add option to render spaces for stringified objects
- Ability to mimic a read-only state HOT 2
- Prompt/input styling is only applied to the latest prompt/input HOT 2
- passThroughCommand like prop HOT 3
- Support for confirmation lines? HOT 2
- Possibility of catch all command? HOT 2
- Is there a way to display the text information that has been passed on? HOT 2
- Dual Input & Output terminals HOT 4
- "ReactHotLoader" occurrences in published package HOT 6
- Feature request: Command completion HOT 2
- [object Object] when dangerMode={true} HOT 8
- pushToStdout function changes the state inplace
- Is it possible to simulate typing? HOT 1
- Query regarding support for react native. HOT 1
- Wrap input instead instead of horizontal scrolling HOT 1
- Is it possible to enter text in console manually from server without typing a command? HOT 1
- dangerMode echos the custom label as [Object, object]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-console-emulator.