Unable to pass #qp2 after changing to raw terminal mode

During #qp2, I’ve changed the terminal to raw mode to implement tab auto-complete.

However, after implementing the autocomplete, the redirection tests are now failing. Not sure what is causing this.


This is my local output and the test output.

(Currently suspect that the redirection directory is not created in this step?)
Is anyone facing any similar issues / am I missing something?

1 Like

Hi, thanks for your post!

I’m currently out of the office and will return on Feb 3. I’ll get back to you as soon as possible after I’m back.

@Jh123x, sorry for the delayed response!

Are you still running into the same issue?

If yes, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

@andy1li hi! I’m having the same issue with #qp2. Autocomplete tests pass, but the redirect to the file from a non-existing directory fails. I’m having trouble reproducing this scenario locally because it seems working, unless there are some interesting assertions in the test that I can’t figure out based on the plain error message.

Here is the output from my shell

$ cat /tmp/foo/baz.md                   
cat: /tmp/foo/baz.md: No such file or directory
$ ls /tmp/foo                           
ls: /tmp/foo: No such file or directory
$ ls -1 nonexistent >> /tmp/foo/baz.md  
ls: nonexistent: No such file or directory
$ cat /tmp/foo/baz.md                 
$ ls /tmp/foo                         
baz.md
$ 

I also pushed my repo to GH as you’ve mentioned above. Thanks for any hints.

@igor-ladkin Since you’re introducing raw mode into the codebase, tests are now failing from stage 2: #CZ2 (Handle invalid commands).

Suggestions:

  1. Use our CLI to test against previous stages by running:
codecrafters test --previous
  1. Focus on fixing the early stages first, as later stages depend on them.

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.