-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
pretty unicode banner #14733
Comments
Dependencies: #14559 |
Attachment: trac_14733_banner_unicode.patch.gz |
comment:2
Since we are already going all-out, how about color instead of a second box for the warning. |
comment:3
I do not know how to put color, but this is a good idea. I would put the bold box in red, or the bold box and its content in red. |
comment:4
here is color version for the bot: apply trac_14733_banner_unicode_color.patch |
comment:5
apply trac_14733_banner_unicode_color.patch |
comment:6
Is there somebody interested to review this patch ? apply trac_14733_banner_unicode_color.patch |
comment:7
Hmmmmmmmmm I don't know what is happening but applying this patch makes absolutely NO difference to the banner I see when Sage starts Nathann |
comment:8
The banner you see on startup is cached output from the sage-sdist script. |
comment:9
Oh. And how can I test it then ? Nathann |
comment:10
I manually updated
|
comment:11
Also, wouldn't it be better to have no empty lines in the warning box? Having one box with and one box without the blank lines really triggers my OCD ;-)
|
comment:12
Attachment: trac_14733_banner_unicode_color.patch.gz apply trac_14733_banner_unicode_color.patch
|
comment:13
If you look at |
comment:14
ok, you are right. But what to do ?
But maybe one has to declare the unicode encoding in the first line of this file too ? I do not know is bash is friendly with unicode. And I have no idea how to deal with this kind of change, I have only worked with patches so far, never with any spkg. |
comment:15
No spkg changes required, you just need to write a patch against the |
comment:16
ok, so here is a patch, but still I am not sure if bash/sed can handle unicode cleanly. |
comment:17
Sed just operates on byte strings. I would prefer to make the regex less likely to break by just matching for the part that we want, not the part that we don't want:
|
This comment has been minimized.
This comment has been minimized.
comment:18
ok, I agree that this is better. Here is a modified patch. apply trac_14733_banner_unicode_color.patch trac_14733_version_regexp.patch |
comment:19
well, the bot does not seem to understand that one patch is for the SAGE_ROOT directory.. |
comment:20
Yes, thats a limitation of the patchbot |
comment:21
Sorry, I forgot to start the regex with "Sage Version". The |
Attachment: trac_14733_version_regexp.patch.gz |
comment:22
here is a corrected patch |
This comment has been minimized.
This comment has been minimized.
Reviewer: Volker Braun |
comment:24
I wonder whether coloured UTF-8 passes easily on most terminal, in particular quite a lot of users use sage through a ssh connection. I didn't test further, but on
|
comment:25
I tried with more terminal emulators (still using Debian wheezy), and
Acces via various ssh connection (especially Putty on windows connecting to various server settings) should be tested as well. While i find this banner very pretty, i do not have any idea how to fix this encoding issue. Any idea ? |
comment:26
Given that Sage is gravitating towards UTF-8 encoded source files (and, by extension, docstrings), I would argue that it is a feature that we make it immediately and unambiguously clear to the user that his terminal does not support utf8. There is no API to query the terminal whether it is utf8 capable, you essentially can only check it by displaying some non-ascii characters. Also, even if you don't have a UTF-8 capable terminal you can still use Sage, only the banner looks funky. In particular, nobody should be using the following any more at this time:
Plain xterm, urxvt, and gnome-terminal work for me. Ssh will happily pass UTF-8 through, it is the terminal at the other end that needs to be able to display it. |
comment:27
I've posted a RFC to sage-devel: https://groups.google.com/d/msg/sage-devel/GbaC9yeicAY/GHYcXAoxxP8J |
comment:28
This is somewhat unrelated comment, but the following may be considered by the patch writer. The first line "Sage Version 5.8, Release Date: 2013-03-15" may be simplified to "Sage 5.8, released on 2013-03-15" I think currently "Version" is unduly prominent and "Date" seems redundant. Too much minimalistic? :-) |
comment:29
well, there seems to be no much hope to get that patch in sage, so let me keep the patch as it is for the moment. |
comment:30
and let me keep this as need review in the present state, just in case somebody is interested |
comment:31
Replying to @fchapoton:
I used the patch, and I think it is beautiful. I completely disagree with the comments such as " I dislike the UTF-8 banner because it looks too nice." and "Keep the banner short and simple ; people don't come to sage to enjoy that sight!" Clean beauty is exactly what people (at least me!) want in software. The banner in Sage right now, which I probably wrote (?), looks frankly ugly and like a hack, compared to the one on this patch. Also, UTF is clearly the future of strings, having native default support in modern interpreters, editors, etc., and also being critical to supporting users who aren't using English. This patch is along the same lines as the recent inclusion of a nice color prompt (thanks volker), in that it makes Sage prettier and more pleasant to use. So my strong vote for this ticket. Moreover, I like it so much I'll be henceforth applying it to the standard system-wide version of Sage at https://cloud.sagemath.com, even if it doesn't get into Sage. In particular, I disagree with " If you're doing something that requires nice output you should probably be using a notebook interface anyways" -- since the terminal interface is part of the notebook interface now, and it must look nice. |
comment:32
Thanks William for your strong opinion. I hope that somebody will soon find the time to review this patch. |
Changed reviewer from Volker Braun to Volker Braun, William Stein |
comment:35
Replying to @nathanncohen:
Apply the two patches, start sage and type |
comment:36
Wow. Nice ! Nathann |
Merged: sage-5.12.beta1 |
comment:38
This probably causes |
Using unicode, one can get the banner to look like that:
Apply:
Depends on #14559
CC: @sagetrac-tmonteil
Component: user interface
Keywords: banner, unicode
Author: Frédéric Chapoton
Reviewer: Volker Braun, William Stein
Merged: sage-5.12.beta1
Issue created by migration from https://trac.sagemath.org/ticket/14733
The text was updated successfully, but these errors were encountered: