Does Ruby have command to format the screen like QBASIC? - ruby

QBASIC have some commands, such as LOCATE (x, y) that place the cursor at certain location on the screen, and CLS that clears the screen, which help a console application look clean.
Does ruby have the same functionality? It could be nice to use it for a small project.
Thanks for helping

No, but look up ncurses.
http://ncurses-ruby.berlios.de/

You can clear the screen with system "clear", and print the whole screen each time.

Related

Customize windows hotkeys

My question is about a way to speed-up everyday writing. I'm often required to repeat certain text-snippets in different forms. One way is to use:
Ctrl-C and Ctrl-V
but I want to keep the Ctrl-C for temporary text-snippets and be able to create a custom hotkey where I predefine the text that I can paste, e.g. if I press Ctrl-T, while having the mouse in the url-entry in a browser, a string like "hi, I hope you are well!" will be pasted. I have been looking into using the windows powershell, but I'm not experienced enough to do this...
Thx for any help (be gentle, this is my first question!) and thx for all the help throughout the years :)
Ahh it seems #EBGreen's idea did provide a good answer! Thanks :) Here is what I found:
^j::
Send, name.surname#company.com
return
binds Ctrl+j to the string "name.surname#company.com", when using the autohotkey-language.
Check out https://autohotkey.com/ for more details!

How to keep same line on terminal top with long output?

Under Ubuntu 14.04, I'm writing a script that output a lot of text (several commands...), and I would like to keep one or more lines always on top of the terminal screen to display what's running title.
In other words, I try to reduce terminal vertical scroll zone and write in that non-scrolling zone.
How can I do that? I saw similar stuff using a loop catching output line by line, but I'm unable to find a way to tell the system to print from let's say line 2 or 3.
Thanks for your answers,
Nicolas
Nic, it appears this does quite nicely.
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html

Scroll up in mongo console on Windows

I need to see output of db.currentOp() in my mongo console (mongo.exe) on Windows. But it gives so much results that they don't fit the screen. If I scroll up with the scrollbar on the left, I still can't get entire output. Is there a way to see the entire output?
Thanx
It sounds like you need to increase the Screen Buffer Size in your Windows Command Prompt settings.

Batch file to set the position of the curser on windows 7 OS. How?

is it possible to make a batch file that sets the position of the mouse/curser to an (x,y) coordinate on the screen? and if so, then is it possible to click on something that is in that position? Any ideas would be helpful! Thanks!
No. You would have to have a seperate executable to do this for you.
It may be possible in VBScript.
P.S. If you're interesting in automating tasks I'd download something like a mouse recorder for something simple like that. If you're automating more complicated tasks, give a shot at Autoit.
No and Yes.
You can't place the cursor at Position X,Y with pure batch, but you can replace the cursor to the home position in one line, and then you can rewrite the content.
For detecting mouse clicks with batch you need an external tool.
Try a look at Lingubender Tan's Batch tools
EDIT: You can place the cursor with pure batch to the home postion, but I need the help of the user, till now.

How do I make bash reverse-search work in Terminal.app without it displaying garbled output?

Using Terminal.app on OS X 10.5, often you see the commands get garbled when you do a reverse-search with Bash. Is there some kind of termcap or perhaps a bash shopt command that can fix this? It is very annoying.
Steps to reproduce: Open Terminal.app, reverse-search to a longish command. Hit <ctrl>-E once you've found the command. The cursor goes to the end of the line, but the display doesn't update.
I'm guessing this is some kind of problem with the readline library on OS X. It's more of a problem with updating the cursor position after a search than anything else. Basically, ctrl-a and ctrl-e tend to break the search output.
os x terminal failure image http://involution.com/images/osxterminal.png
In the above, the first part of the command should be displayed, and the cursor should be at the end of the line, but it isn't. You literally can't see what you're editing when this happens.
I was able to set my TERM to xterm instead of xterm-color and it solves the problem. (export TERM=xterm).
You may want to look at this post.
bash-prompt-in-os-x-terminal-broken
I had the same problem and it had to do with the PS1 variable. Let me know if this helps.
If the prompt has colors, then this is an acknowledged bug.
See bug report msg#00019.
I've encountered this bug, and while I don't know how to solve it, you can work around it by pressing <down><up>
Not sure whether this is the problem here, but a very common cause of a messed up screen in bash (with any terminal emulator, not just Terminal.app) is the window being resized.
Bash will read the window size when it starts up, and then assume it hasn't changed. When the window is resized a signal will be sent to whatever app is currently reading from the console. If this isn't bash (because you're running a text editor at the time, perhaps), then bash won't know about it.
Solution in this case is to resize the window again so that bash gets the signal and notices the new size.
I can't reproduce this, hitting either Ctrl+E, Ctrl+A or the arrow keys updates the command line correctly. Are you running 10.5.4? Is it perhaps a bug in earlier versions?
In worst case, you could launch the X server (somewhere under utilities) and launch a real xterm.

Resources