Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1. Allow absolute paths; 2. File not closed; 3. ANSI escape sequences not stripped #2

Open
paul-j-lucas opened this issue Apr 29, 2021 · 1 comment

Comments

@paul-j-lucas
Copy link

There are a few problems with this code:

  1. It should allow absolute paths. Specifically, it should not prepend ./ to the path. It should simply leave the path alone.
  2. The file isn't closed.
  3. When you send the output to a file, LLDB includes what it would have sent to the terminal verbatim. For a color terminal, this includes ANSI escape sequences. These should be stripped from the output.

I would have created a branch and submitted a pull request, but don't have write-permission to the repo; so here's a patch.
patch.txt

egachi added a commit to egachi/lldb-write that referenced this issue Jul 28, 2021
Adding recommendation from 4iar#2
4iar added a commit that referenced this issue Aug 10, 2021
4iar added a commit that referenced this issue Aug 10, 2021
From #2

Wraps the file handling in a context manager that automatically closes
the file (see https://stackoverflow.com/questions/21275836/)
4iar added a commit that referenced this issue Aug 10, 2021
@4iar
Copy link
Owner

4iar commented Aug 10, 2021

Hi!

Thanks very much for taking the time to write this feedback & send a patch

I agree with all these points and have merged fixes for the first two. I will merge the third soon.

Cheers! (and sorry for the late reply)

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

No branches or pull requests

2 participants