Comments (4)
You don't mention which script -- I assume you're talking about termsize? I can't find those two lines in any of my scripts, but termsize has lines that are similar though not the same, Are you perhaps using an old copy? Please make sure you're up to date, and if you still see a problem, let me know which file and which lines you're talking about.
Without that blank line, if I run it in xterm, I get a blank line anyway, but then the first character of the next line gets swallowed up, so I see: "\neset** the terminal to 40 rows, 80 cols" (no R in Reset).
This seems to be very terminal dependent, though; If I run it in urxvt, it gets the size correctly but spits out extra characters which have to be **erased (and the R is missing again). I should probably open a separate bug on that (just did, issue #19). I'm not sure why it happens and I've just been putting up with it.
What terminal program are you using? It would be nice to find a terminal independent fix. I may need to read some sequences from terminfo.
from scripts.
Oh, nuts, I did forget to mention the script! Yes, when I was testing I notice that 'missing character' quirk as well. So I left the newline character and just forced the cursor up 1 line vertical. I use serial consoles and PuTTY based virtual terminals on IoT devices, like Raspberry Pi devices, etc. So my tweak works on those.
Another test I did was to just store the cursor position, adding a bit of python code, let everything happen, then restore the position before the final printf. This worked as well for my testing. Of course, VT terminal emulation and nested cursor positioning can be a bit of PITA, but for what I tested this also worked fine for me.
The odd thing was, I was expecting the kill of echo, to stop python from generating any thing to screen/console, but that stills seems to happen, hence the odd quirks we both have commented on. This seems to be specific to the actual terminal emulation in some respect, for example in a classic VT220 actual terminal, when you killed echo... it was killed, nothing ever go to screen, thus on cursor movement or position change.
Man, I am dating myself, right? Who even remembers actually using a real VT102 or even a VT220 terminal these days?
from scripts.
I could never afford a real VT??? terminal back in the day. I used an assortment of terminals that had termcaps derived from vt52 or h19. :-)
I poked at this a bit, trying to figure out why on urxvt I was getting the characters echoed in a way that made them act like typed characters, but I didn't make much progress. I ended up with a quick fix: if the curses module is available, use that (curses manages to deal with both xterm and urxvt, at least), and if that doesn't work, fall back on the old code. And I did remove the extra blank line before the line it prints at the end. That means in xterm, without curses, the first R of "Reset the terminal" won't get printed, and the first time termsize is run it may output a bunch of blank lines; but curses is part of the standard library, so hopefully most people will see that version.
Let me know if you have problems with the new version.
from scripts.
Will do, I should be able to test this update in the next day or so. Thanks for working on this, really cool when people actively support solutions.
from scripts.
Related Issues (14)
- termsize: without python HOT 4
- Awesome HOT 3
- be resilient to decoding issues? HOT 2
- conjunctions.py crash HOT 1
- termsize: extra characters in urxvt HOT 1
- viewhtmlmail chokes on maildir HOT 3
- termsize curses version does not work for me HOT 4
- viewhtmlmail.py fails for certain characters HOT 1
- viewhtmlmail.py with Firefox HOT 9
- weborphans - will it work for website created by MkDocs? HOT 14
- termsize won't work with Python3 HOT 4
- python 3 and block=false HOT 1
- Can't install python-poppler-pyqt5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripts.