# \#TZ2 Failing because of clash with #LC6? Need help!

**URL:** <https://forum.codecrafters.io/t/tz2-failing-because-of-clash-with-lc6-need-help/16199>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [July 7, 2026, 3:19pm UTC](https://forum.codecrafters.io/t/tz2-failing-because-of-clash-with-lc6-need-help/16199 "2026-07-07T15:19:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walheimat](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/walheimat/32/27190_2.png) [@Walheimat](https://forum.codecrafters.io/u/Walheimat)\
**Post date:** [July 7, 2026, 3:19pm UTC](https://forum.codecrafters.io/t/tz2-failing-because-of-clash-with-lc6-need-help/16199/1 "2026-07-07T15:19:23Z")

</div>

I’m stuck on Stage #TZ2

I can’t reproduce the problem locally but it looks like there’s a clash between this task and what #LC6 (directory completion) expects? There you have to complete the first directory if there’s no other completion on second TAB.

Here are my logs:

```auto
[tester::#TZ2] Running tests for Stage #TZ2 (Programmable Completion - Unregister a completion)
[tester::#TZ2] Running ./your_program.sh
[your-program] $ complete -C /tmp/fox/singleCompleter git
[tester::#TZ2] ✓ Registered command-based completion
[your-program] $ complete -r git
[tester::#TZ2] ✓ No output from complete -r
[your-program] $ complete -p git
[your-program] complete: git: no completion specification
[tester::#TZ2] ✓ Found missing completion specification after unregister
[tester::#TZ2] Typed "git" followed by a <SPACE>
[tester::#TZ2] ✓ Prompt line matches "$ git "
[tester::#TZ2] Pressed "<TAB>" (expecting autocomplete to "git" followed by a space)
[your-program] $ git .codecrafters/
[tester::#TZ2] ^ Line does not match expected value.
[tester::#TZ2] Expected: "$ git "
[tester::#TZ2] Received: "$ git .codecrafters/" (no trailing space)
[tester::#TZ2] Test failed

```

I interpret these logs as saying that it completes the first directory after the first TAB press somehow (which I can’t reproduce). My code is using `readline` and just sets a custom `rl_attempted_completion_function`. So my assumption is that I somehow passed an earlier stage despite there being a problem.

---

<div class="post-metadata">

**Author:** ![Walheimat](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/walheimat/32/27190_2.png) [@Walheimat](https://forum.codecrafters.io/u/Walheimat)\
**Post date:** [July 7, 2026, 6:41pm UTC](https://forum.codecrafters.io/t/tz2-failing-because-of-clash-with-lc6-need-help/16199/3 "2026-07-07T18:41:05Z")

</div>

I solved this. The problem was that I erroneously assumed that the directory completer should always only complete the first directory.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [July 12, 2026, 6:41pm UTC](https://forum.codecrafters.io/t/tz2-failing-because-of-clash-with-lc6-need-help/16199/4 "2026-07-12T18:41:50Z")

</div>

Closed on July 12, 2026, 6:41pm UTC

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