mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
133 stars 73 forks source link

mate-terminal: default encoding and settings #192

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello mate-team.

Recently I was able to compile all of mate, the latest, from source.

Things work quite ok; I have another minor issue where the "Applications" part on top left is not populated at all, it is empty. But this is for another issue, just mentioning it here.

Now, this here is about mate-terminal.

The URL I used to compile from source was:

http://pub.mate-desktop.org/releases/1.18/mate-terminal-1.18.1.tar.xz

mate-terminal starts fine and it works fine. There is one thing that is odd about the Encoding though.

I use non-UTF encoding (iso8859-1) and this works fine. For many reasons I'd not like to inflate this, I can not and do not use UTF/Unicode.

Now mate-terminal thankfully comes with a option called "Set character encoding".

There are two drop-down radio buttons - one for Unicode, the other one to use "Current Locale". The default entry appears to be Unicode, which means that I always have to change it to my locale here. And I see no easy way to change this?

I have two suggestions to make here and I will explain both:

(1) Right now it appears to be that, when you change towards to use "Current Locale", this is only valid for the CURRENT tab. So if I have 10 tabs, I have to change it for every tab. This is very cumbersome if you use many tabs.

Also, if I set the tab that is e. g. to the most right point towards Current locale, and then click on "open a new tab", that new tab will have Unicode as the default again rather than the locale.

So here I would like to propose an option to propagate the change to all tabs. That means if I change the option for one tab, it is actually propagated to ALL tabs. I do not intend to change the current default, so people who like the CURRENT behaviour, can keep on using it.

What I suggest is an ADDITIONAL option. This could be a new entry point at the menu point that uses "Set Character Encoding", something such as a new one below the current ones called "Propagate this locale to all tabs". That way, it would be very convenient for people to be able to use that locale for all tabs. Again, I do not intend to change the default behaviour at all - I know myself that it can be very annoying for people when they have to adapt. That is why I suggest a NEW option there. :)

It does not necessarily have to be a new option either, IF there would be another way altogether. Perhaps right-clicking on the entry where you can set locales, with a context menu popping up if the right mouse button is clicked - this would also be an alternative. I don't mind either way, both is better than the current cumbersome way to have to manually set it for all tabs.

(2) The second suggestions I have is ... perhaps mate-terminal could use some environment variable or so? I'd be perfectly fine with that, something such as MATE_DEFAULT_ENCODING = and being able to set this then.

This would allow me to start mate-terminal with that encoding in use.

It's ok that Unicode is the default, I guess most people may use it. But for many reasons some people may not be able to use Unicode or do not want to, so this would be awesome if mate-terminal could pick up on some encoding value. In this example here, it would allow us to not have to manually pick the encoding to use from the menu bar and instead use an environment variable instead.

Thank you for reading - please do feel free to close this issue at any moment in time for any reason!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/48881103-mate-terminal-default-encoding-and-settings?utm_campaign=plugin&utm_content=tracker%2F757836&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F757836&utm_medium=issues&utm_source=github).
egmontkob commented 6 years ago

May I recommend to backport gnome-terminal's current solution, which is to specify the default encoding in profile prefs -> compatibility ?

egmontkob commented 6 years ago

See also #132.

cron2 commented 6 years ago

bumped into this today, searching for a way to run mate-terminal with the encoding specified on the command line (and/or specifying a profile name which I hoped would include the encoding, but it doesn't).

My use case is basically "mate-terminal -e ssh $somehost" where "somehost" runs a non-UTF8 encoding - I'm a sysadmin, these are old legacy systems but I still need to work with them, and they just do not do UTF8.

egmontkob commented 6 years ago

Until mate-terminal properly addresses this, you might use luit as a workaround (between mate-terminal and ssh).

caltrop2075 commented 6 years ago

I have been questing for a way to change the default terminal character encoding. I found what I want but it needs setting every time the terminal is opened.

I'm trying some old-fashioned Ncurses programming and need the Extended ASCII Characters for borders.

This 'NEW' International stuff is ANNOYING!!!

caltrop2075 commented 6 years ago

One more thing about mate-terminal, it will not allow key trapping for all keys.

Keys like F-1 are intercepted by mate-terminal before the program has a chance to get it no matter that the key trapping is turned ON in Ncurses (raw & cbreak).

I thought there were Unix/Linux standards but it looks like every distro does whatever it wants. Rules for us, none for THEM! Just like in the world we exist in...

egmontkob commented 6 years ago

(Disclaimer: I'm not a MATE Terminal developer.)

it will not allow key trapping for all keys

You've reported it as #196, and apparently didn't notice my comment. Not sure why you brought it up here.

Your wording with "trapping" and "turned ON in Ncurses" suggest that you fundamentally misunderstand the situation. It is not like applications (or ncurses) can ask the terminal emulator to start/stop telling them about F1. That's how mouse works, but not the keyboard. No matter what is happening inside the terminal emulator (e.g. what application is running), MATE Terminal always does the same thing on F1, which is: If it's a defined hotkey in MATE Terminal's preferences then invoke the corresponding action, otherwise send it to the app running inside which will do (or not do) whatever it wants.

This 'NEW' International stuff is ANNOYING!!!

As far as I understand, here you're referring to Unicode (UTF-8) which is the only character set capable of supporting the requirements of all the languages at once, has been the default encoding of Linux systems for mode than a decade now, is default encoding of the Web used by 90% (and still growing) of webpages, etc.

Today the only valid reason for switching to non-UTF-8 is if you heavily rely on backwards compatibility, e.g. run an existing app that fails with UTF-8. Even if you're dealing with non-UTF-8, whenever possible, it should be done by running under a UTF-8 locale and converting the data at the endpoints. Writing a new app that doesn't support UTF-8 is utterly unreasonble.

I'm trying some old-fashioned Ncurses programming and need the Extended ASCII Characters for borders.

What makes you think ncurses cannot use border-drawing characters in UTF-8? Of course it can. If it didn't work for you, I'm sure people can help you out on various programming forums.

I thought there were Unix/Linux standards

Please don't get offended by this, but waving the "standards" flag (even throwing in "POSIX" as a well-sounding random word in the other bug) where MATE Terminal has a default shortcut defined for F1 (which is damn easy to disable), and at the very same time deciding not to support the standard UTF-8 encoding in your app is one of the most ridiculous things I've heard in quite a while.

This 'NEW' International stuff is ANNOYING!!! [...] I thought there were Unix/Linux standards but it looks like every distro does whatever it wants. Rules for us, none for THEM!

I find your style (blaming everything when things don't exactly work the way you want) way out of line, and your knowledge is clearly nowhere near to back up any bit of it. Unless I see a substantial improvement of your manners, I promise I won't answer to you anymore.

I've shown you how to "fix" F1, you didn't notice that. I've mentioned "luit" as a possible workaround, apparently not good for you. Now I've mentioned that going with non-UTF-8 is absolutely wrong, not sure what you'll think of it. Let me also mention that there are like 10-20 or so terminal emulators shipped by most Linux distributions, you don't have to stick to one that's not good enough for you. I hope I could help.

That being said, the current enhancement request (bugreport if you will) is still a valid one. (Your use case for hitting this limitation is not.)

miragu commented 6 years ago

Posting to say I'm suffering with this as well with 1.21. Switched temporarily to xfce4-terminal, which is light on dependencies and practically equivalent. They solve the problem simply by saving the chosen (global) charset preference. It's not per-profile, which would be optimum, but it's good enough for me. Please implement one of these simple fixes.