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

add terminal256color option #93

Merged
merged 1 commit into from
Dec 31, 2017
Merged

add terminal256color option #93

merged 1 commit into from
Dec 31, 2017

Conversation

howeyc
Copy link
Contributor

@howeyc howeyc commented Dec 26, 2017

this will allow terminals that support 256 color ansi codes to have
preview applications use 256 colors

@howeyc
Copy link
Contributor Author

howeyc commented Dec 26, 2017

I'm not sure you want this, or are interested, but it's here if you want it. I am willing to change it if I've added it a way that isn't quite right.

For some background, I added this to have images preview look a lot nicer. I found an application that will output an image using ansi colors, but it uses 256 colors. I think it looks pretty nice.

This is what I used for outputting the image to ansi codes for terminal if you're curious: https://github.com/stefanhaustein/TerminalImageViewer

@gokcehan
Copy link
Owner

@howeyc Thanks for working on this. Sorry, I couldn't get back to this earlier.

I tried to run with this patch but I can't seem to get it working. Can you confirm one of the 256 color test scripts on the internet displays all colors correctly in preview? Also how do you use tiv with your preview script? I tried to use something like tiv -0 -256 -w 50 "$1$" but it doesn't seem to be working for some reason. Any advice?

@howeyc
Copy link
Contributor Author

howeyc commented Dec 28, 2017

It works fine for me. So I'm not sure. You have an extra $ in your command, unless that's just a typo in your comment, in which case I have no idea why it wouldn't work for you. Does your terminal display correctly running "tiv" from the command line? Maybe your terminal does not do 256 color mode?

@gokcehan
Copy link
Owner

@howeyc I'm not sure how but I can see all 256 colors now and I don't recall trying something different. Maybe simply restarting the terminal might have helped.

Extra $ is a typo here and I still can't use tiv for preview. We can still merge the patch and maybe I try to play with it later on. I suspect though we may also need to pass a width parameter to the previewer script to use tiv properly.

Back to this patch, do we need to make this an option instead of having it on at all times by default? Is there a drawback to this? As far as I can see, it doesn't seem to change the 8 color palette that we're currently using. I will also try to run this on windows to make sure it doesn't break anything there.

@howeyc
Copy link
Contributor Author

howeyc commented Dec 28, 2017

You're right, having it on all the time may be fine as original colors will still work.

I'll be interested to hear your results for Windows.

@gokcehan
Copy link
Owner

@howeyc I don't see anything broken in windows although only some colors are displayed properly in the preview pane. I suspect this might be related to termbox. I think it is ok to merge this patch and we can work on windows later on. So shall I wait for you to remove the option logic and make this default?

@howeyc
Copy link
Contributor Author

howeyc commented Dec 28, 2017

Yeah. I can fix it up to be always 256 color and remove option. It'll be 12 hours till I can get to it though, up to you if you want to wait.

@gokcehan
Copy link
Owner

@howeyc You can change it whenever you want, no need to hurry :)

this will allow terminals that support 256 color ansi codes to have
preview applications use 256 colors
@howeyc
Copy link
Contributor Author

howeyc commented Dec 31, 2017

Not sure if you saw this. I made the change so that 256 colors is the default.

@gokcehan gokcehan merged commit ec8e75b into gokcehan:master Dec 31, 2017
@gokcehan
Copy link
Owner

@howeyc I did not get any notification. Anyway, thanks for the patch. Happy new year.

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