Git Product home page Git Product logo

Comments (4)

machow avatar machow commented on September 22, 2024

@filipsch this is not ideal, but history expansion is not an issue for the NormalExercise. It will see !cat

(context here: https://github.com/datacamp/shellbackend#kernel-limitations)

from shellwhat.

gvwilson avatar gvwilson commented on September 22, 2024

Thanks @machow - why does the expansion show up in NormalExercise but not in ConsoleExercise ??

from shellwhat.

machow avatar machow commented on September 22, 2024

@gvwilson the NormalExercise is similar to writing bash code in a file. The backend receives the raw code in that file and decides how to run it / passes it to the SCTs. In a ConsoleExercise, the student is delivering STDIN to a terminal, which could be doing anything to that input. Seeing

> !cat

when a student types !cat is just a side effect of how the shell is running at that moment in time (for example, if they had vim open and typed !cat the result would be very different). There is no "student code". All we know is that they typed a stream of characters (including delete, etc..), and some ascii canvas thing has drawn a bunch of characters.

Through bash hooks and black magic, we can get back what code they are running when they run it, and give it to the SCTs. However, bash doesn't see !cat. Very early on when bash is interpreting !cat it expands it. This happens before bash even chops commands into separate "words".

(the issue referenced in the README I linked above points to the relevant bash docs)

from shellwhat.

filipsch avatar filipsch commented on September 22, 2024

I think this issue is not worth looking into. It's going to be used in 5 to 10 exercises at most in the coming year (currently only 1).

from shellwhat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.