Saturday, June 23, 2012

Terminal Control Character Mayhem

If I am using Konsole, or sometimes even a virtual terminal, I can cat a file, and it gets dumped and sent to the program that has to interpret it.


Well, some binary data might indicate a change in character encoding...
So my terminal gladly switches to another character encoding set.


I would like to include in my Prompt(all prompts that anybody uses), some sort of  way to for-sure return to my expected character encoding.

Other ways to do this may include disabling switching of encodings (which might break some programs)

or wrap or alias commands like "cat" to encode all characters in printable standard characters. (some sort of escaping to represent what the non-printable characters are.

I think the prompt is the best place to look. The terminal programs themselves are also a prime place for work.

Either way, it is unacceptable for my whole screen to turn into gibberish just because I used cat to inspect a file... and I still don't know of a fix!

Monday, June 11, 2012

Policy for keeping filenames sane

Have you ever created a file with the name "-rf"?

Or used KDE where a "/" was interpreted as some character that looks like a slash, but is not one? and totally borks your computer?


I would like to create a system-wide policy that does not allow insane filenames to be created.

This potentially means banning look-alike characters.

The complexities in this system would be when including filenames with characters from languages other than English.

We could have a dual file-name system...

And Or we could use the hash of a non-compliant filename.


Basically I want the filesystem to be able to  give an error if a file name starting with a dash, or has a space then a dash, or contains certain reserved words separated by spaces.  If it has a non us-english keyboard character in it..

This could add substantial overhead to some writing operations...  and it could add danger for programs that do not try again if write was unsuccessful.

This program could also save the file regardless, but name it in a compliant fashion.... but it is better to just error out.