Skip to content

fix(pwd): Fix an issue where tide would error on a too long pwd#12

Open
d4wns-l1ght wants to merge 1 commit intoplttn:mainfrom
d4wns-l1ght:main
Open

fix(pwd): Fix an issue where tide would error on a too long pwd#12
d4wns-l1ght wants to merge 1 commit intoplttn:mainfrom
d4wns-l1ght:main

Conversation

@d4wns-l1ght
Copy link
Copy Markdown

@d4wns-l1ght d4wns-l1ght commented Jul 29, 2025

See IlanCosman#499

Description

The function being edited works fine otherwise, but adding the pipe into echo just removes a very annoying error message.

Closes #11

How Has This Been Tested

  • I have tested using Linux.
  • I have tested using MacOS.

Checklist

  • I am ready to update the wiki accordingly.
  • I have updated the tests accordingly.

@faho
Copy link
Copy Markdown

faho commented Jul 29, 2025

This is broken - echo does not read from a pipe, so contains ... | echo never does anything but print an empty line, even if contains succeeded. You've disabled the entire contains logic, always.

What you could do instead is to print the full range if contains fails:

contains -i \$parent_dir/\$dir_section/ \$glob; or echo 1..-1

This will have the effect of erasing $glob if the pwd is too long, and won't do anything otherwise. I think that's right, but I don't know the full context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error printed in _tide_pwd when terminal is too narrow

2 participants