Terminal Activity: Difference between revisions
m (→The Console: clarify console terminal) |
|||
Line 39: | Line 39: | ||
== Copy and Paste into Terminal Window == |
== Copy and Paste into Terminal Window == |
||
It IS possible insert text in the Terminal Activity without having to use a pen and paper. All you have to do is highlight the text you want to insert. Then, go back to the Terminal Activity, and on the two buttons below the XO Touch Pad, you click right in the center of the two and that's it! |
|||
It is not possible to [[Terminal#Cutting and Pasting|copy and paste from]] the [[Terminal]] as of [[Builds|build]] Ship.2 (the version all G1G1 donors received). |
|||
So, if you are following some instructions from a web page in the Browse activity, and want to copy them into the Terminal activity, a pen and paper is required unfortunately. |
|||
Copy/paste is possible in [[Update.1]], but {{Trac|5376|DnD does not work in Terminal.activity}}. |
|||
There is a partial work-around for this problem, using the third button of a mouse. See [[Scroll-Wheel Copy and Paste]]. That page also has instructions to make the right touchpad button act like the third button of a mouse. |
|||
<gallery> |
|||
Image:Example.jpg|Caption1 |
|||
Image:Example.jpg|Caption2 |
|||
</gallery> |
|||
=== Paste script === |
=== Paste script === |
||
Revision as of 18:34, 14 February 2009
Image:Support-banner-square.png|173px|community support pages rect 0 0 135 204 [1] rect 135 0 345 204 Support FAQ rect 0 205 135 408 [2]
- Comment : there's some whitespace here:
rect 135 205 345 408 Other support
- maybe desc none is better. testing.
desc none
</imagemap>The Terminal activity grants access to the XO's Linux command line.
The Terminal is an Activity that allows you to control your XO directly from a command line, similar to the Terminal program in Mac OS X or the Command Prompt in Microsoft Windows. The Terminal allows you to do far more with your XO than running Sugar activities. But it is also possible to delete your data, and the system data from the command line, so be careful.
BEWARE: If you become user "root" by executing "su -l " you have full control — you can destroy all software!
Starting Terminal
The Terminal Activity is found in the Activities taskbar at the bottom of your Home View. You may need to scroll through the Activities taskbar by using the right arrow icon at the bottom of your screen () to find the icon.
Starting a console
You can also access a Linux command prompt by switching to the console, instead of starting the Terminal activity.
Common Terminal Commands
- sugar-control-panel - Change nickname, XO Color, time zone and other options
- ifconfig - View Wireless Network connections
- nano for editing text files directly. If you want to edit text files in Sugar, use Write.
- yum for automatically installing new software.
- rpm - another way to automatically install new software
- olpc-logbat - log the activity of the battery system. Useful for assisting developers in debugging battery problems.
You can find Keyboard Shortcuts.
There are hundreds of Linux commands available in the Terminal, Linux software describes some more of them. The core Linux distribution used on the XO is Fedora.
Copy and Paste into Terminal Window
It IS possible insert text in the Terminal Activity without having to use a pen and paper. All you have to do is highlight the text you want to insert. Then, go back to the Terminal Activity, and on the two buttons below the XO Touch Pad, you click right in the center of the two and that's it!
Paste script
You can create a script that pastes text from the clipboard into Terminal.
Open a terminal and create a new file named paste in the home directory, this can be done with nano for example.
nano paste
In the file enter the following
#!/usr/bin/python import pygtk import gtk cb = gtk.clipboard_get(selection = "PRIMARY") print cb.wait_for_text()
Save and exit, then make the file executable by entering
chmod a+x paste
Finally to run the script to paste from the clipboard enter
./paste
Change font size in the Terminal Activity
Here is how to increase the print size in the terminal:
- Launch the Terminal activity.
- Type
nano ~/.sugar/default/terminalrc
- Find the line saying
Font = Monospace 8
And change it to
Font = Monospace 16
(or whatever you want).
- Press Control-X and answer Yes to save.
- Close the terminal activity (the X in the top right-hand corner)
- Re-open the terminal activity, the terminal should now be in larger print.
The Console
Another way to bring up the Linux command prompt is by pressing the Ctrl+Alt+Neighborhood keys at the same time (the Neighborhood view key is represented by a circle with 8 small dots ). This will switch to a console terminal that runs outside the Sugar UI and X Window System. The console also displays some internal messages during XO operation. (Note that many Sugar binding are not available in the console, so commands such as sugar-control-panel will not work there.)
To return to the X Window System environment, press Ctrl+Alt+Home keys ().
There is a second terminal (technically, /dev/tty2) outside Sugar that you can switch to by pressing Ctrl+Alt+Group keys ().
Logging in to the console
In "Ship.1" releases (builds 650, 653, and 656), the console may give you a login prompt and require you to login before you can enter commands. If so, type root and press the Enter key,
xo-NN-NN-NN login: root
In more recent builds both virtual terminals log you in as root after you first press Enter.
You are now logged in as the root user, be careful.
Changing font size in the console
To increase the font size in the console, type:
setfont sun12x22
For a list of other console fonts, look in /lib/kbd/consolefonts/ and type:
ls /lib/kbd/consolefonts/*.psfu.gz
(remove the suffix .psfu.gz when used with the 'setfont' command)
For a permenant change, edit the line:
" ro ${ROOTDEV} console=ttyS0,115200 console=tty0 fbcon=font:sun12x22" expand$ to boot-file
in /boot/olpc.fth and substitute 'sun12x22' with your font choice.
Cutting and Pasting
Using build 650
It is not possible to cut and paste from the terminal to other activities. However you can use the the clipboard function (i.e., to cut and paste) to drop text into a terminal if you attach a 3 button USB mouse to your USB port. After you have copied text from the web page(usually Ctl C), switch to the Terminal activity, put your cursor on the command line and click your middle button. Doing that should cause the text to be copied successfully.
- Isn't it possible to configure the X Server so that the "double chord" of pressing the left and the right mouse button at the same time, emulate the middle mouse button? But even simpler would be to use the right mouse button for pasting since it is not currently used in the terminal. -- Dov Grobgeld - 2008-01-23
Also try "CTRL+SHIFT+V" for paste.
Alternative terminal program
You can install gnome-terminal:
su -l yum install gnome-terminal
NOTE - how do we launch the gnome terminal??
you would have to use an existing terminal session to launch a 'gnome terminal' session, until a sugarized version is available.
See Also
- Linux software A brief description of some of the linux software that is installed with Sugar.
- BASH Reference A longer list of commands and programs that
can be usedcould be usable in the Terminal but many are not installed because the xo has acastratedspace-constrained version of linux. 76.115.84.114 18:46, 2 September 2008 (UTC)