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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: filter ANSI color for shell #2529

Merged
merged 2 commits into from Jul 20, 2023
Merged

Conversation

libook
Copy link
Contributor

@libook libook commented Jul 4, 2023

Description

File Browser supports Execute on shell. But shell result may contain ANSI color. Before this project support colored shell, we can filter ANSI color for now.

馃毃 Before submitting your PR, please read community, and indicate which issues (in any of the repos) are either fixed or closed by this PR. See GitHub Help: Closing issues using keywords.

  • DO make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • DO make sure you are making a pull request against the master branch (left side). Also you should start your branch off our master.
  • DO make sure that File Browser can be successfully built. See builds and development.
  • DO make sure that related issues are opened in other repositories. I.e., the frontend, caddy plugins or the web page need to be updated accordingly.
  • AVOID breaking the continuous integration build.

Further comments

None.

@libook libook requested a review from o1egl as a code owner July 4, 2023 04:44
o1egl
o1egl previously approved these changes Jul 17, 2023
Copy link
Member

@o1egl o1egl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide an example of what this pr is fixing? I tried to execute sh -c 'echo "\033[0;31mRed\033[0m"' and the output was just Red

@o1egl o1egl self-requested a review July 17, 2023 11:37
@o1egl o1egl dismissed their stale review July 17, 2023 11:37

Question

@libook
Copy link
Contributor Author

libook commented Jul 18, 2023

Before this fix:
鎴浘 2023-07-18 15-21-42

In system terminal emulator:
鎴浘 2023-07-18 15-23-49

I am using zsh with oh-my-zsh. This fix would remove ANSI colors before the terminal of this project support colored output.

@libook
Copy link
Contributor Author

libook commented Jul 18, 2023

I switch between master and my branch.
This is master:
鎴浘 2023-07-18 15-34-05
This is my branch:
鎴浘 2023-07-18 15-29-25

@libook
Copy link
Contributor Author

libook commented Jul 18, 2023

Execute on shell: /usr/bin/zsh -i -c

@o1egl o1egl merged commit 9bcfa90 into filebrowser:master Jul 20, 2023
8 checks passed
langren1353 pushed a commit to langren1353/filebrowser-player that referenced this pull request Jul 31, 2023
* feat: filter ANSI color for shell

* chore: fix formatting

---------

Co-authored-by: Oleg Lobanov <oleg.lobanov@bitvavo.com>
(cherry picked from commit 9bcfa90)
langren1353 pushed a commit to langren1353/filebrowser-player that referenced this pull request Jul 31, 2023
* feat: filter ANSI color for shell

* chore: fix formatting

---------

Co-authored-by: Oleg Lobanov <oleg.lobanov@bitvavo.com>
(cherry picked from commit 9bcfa90)
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.

None yet

2 participants