GETTING TO AND USING PROJECT VINCENT WITHOUT A WORKSTATION Gary T. Leavens Department of Computer Science, Iowa State University August 9, 1993 This document describes how to get into Project Vincent from someplace other than a Vincent Workstation. It also describes some peculiarities of using Project Vincent and Emacs from the Iowa State Network. 1. PUBLIC TERMINALS You don't need a workstation for most of your work in this class; many terminals on campus will work just fine. Sites with 24-hour public terminals are 89 Durham center, 53 Physics, 101 Sweeney, and many residence halls. There are lots in the library basement. A list of public terminal sites is available in URM 108, which you can get from 195 Durham center. We have also passed out a list in our handout ``Where to find a Workstation or Terminal''. If you see the ``DIAL:'' prompt on a terminal, it's available and hooked up to the Iowa State Network (ISN); so type ``enet'' (without the quotes), then hit ``return''. You will see a menu of selections, select a computer from the menu, for example vincent3, by typing in its number and then ``return''. If you don't see the computer you want, select the number for ``telnet to remote host'' and then type the name of the computer you wish at the prompt, followed by a ``return''. For more details see the Project Vincent User's Guide or URM 108. 2. DIALING IN BY A MODEM At any hour of the day or night, remote access is possible if you have a modem and a computer or terminal. Modems are amazingly cheap (at least to someone who remembers what they used to cost); you can get a 2400 baud modem for peanuts, and a 9600 baud modem for less than $200. (9600 baud modems permit faster communication.) If you are not familiar with this modems etc., look at URM 39, which you can get from 195 Durham Center, it has more details than the following discussion. To connect with a modem, use 8 bits, no parity, and dial 294-1200 (for 300 or 1200 baud), 294-2400 (for 2400 baud), or 294-9600 (for 9600 baud). At the prompt ``DIAL:'', type ``enet'', and press the ``return'' key, you will be prompted for several options. Some of these lead directly to machines you can use for the course, for example, vincent1, vincent2, or vincent3. To select one of these, type its number, then hit ``return''. You may need to press ``return'' a few times, and then you can log in. You can get to another machine by choosing option 1 (``telnet to remote host'') by typing ``1'' and then the ``return'' key, you will then be prompted for a host name; type the name of the machine you want, press ``return'' a few times, and then you can log in. If you live in a dorm room, you can get the Iowa State Network (ISN) hooked up directly to your room. Talk to the ISU Telecommunications Office about it. 3.1 USING THE ISN If you are getting to project Vincent as described above, you are using the ISN. The ISN allows you to freeze (stop) output from the computer, and then to thaw output (let it continue). This is done by using the control characters C-s and C-q. Try the following experiment. At the shell prompt, type sh -c 'while true; do echo hi; sleep 1; done' This starts an infinite loop, printing hi on your screen once every second. While this is going on, type a C-s (press ``control'' and ``s''). You will see the sequence of printing stop. Now type a C-q. You will see several his print all at once, these were saved while ISN was waiting for you to type the C-q. Then you see the normal printing process resume. Try typing C-q now; what happens? After you understand how this works, stop the printing completely by typing a C-c; this kills the Unix process that is printing hi. The point of this is twofold. You can use C-s to stop output. More subtly, if you accidentally type C-s, output will stop. So if you are expecting output and none is forthcoming, try typing C-q to get it started. 3.2 USING EMACS OVER THE ISN Emacs also uses C-s and C-q, but unfortunately it does not use C-s and C-q in the same way that ISN does. Normally (i.e., not using the ISN) C-s means ``incremental-search'' and C-q ``quoted-insert'' and these both work fine. However, the ISN does not transmit C-s and C-q to emacs, but interprets them to mean stop (freeze output) and start (thaw output) before emacs sees them. This section describes some ways to get around that problem. 3.2.1 The Easiest Way You can avoid the ISN entirely by dialing in to enet directly. Try calling 294-3638. Unfortunately, that line is often busy. 3.2.2 The Easy Way The easy way is, after starting emacs, execute the command ``M-x isn-mode''. (That is, hit the ``escape'' key (labeled ESC), then type ``x'', then at the prompt type ``isn-mode'', all without the quotes.) This makes emacs swap the keys C-\ and C-s, and also C-q and C-^. That is, to get emacs to do an incremental search, you type C-\ instead of C-s, and to look for the same thing again, type C-\ again. Instead of typing C-x C-s to save a file you type C-x C-\ . (Or just type C-x s to save all your files.) To get a quoted insert, type C-^ instead of C-q. If you often or usually use the ISN, you can have ``isn-mode'' invoked automatically, every time you use emacs, by putting the following line in your ``~/.emacs'' file. (isn-mode) This has the side effect of using ISN mode even on workstations, but if you use ISN often enough, it is just as easy to learn these keys as the standard ones. 3.2.3 The Harder Way Personally, I prefer a slightly different solution to the problem. The reason is, I think of ``\'' as meaning ``quote'' so I would rather have C-\ stand for C-q. If you want to do this, instead of the above, put the following lines in your ``~/.emacs'' file. ;; additional key bindings for ISN which eats all the C-s and C-q chars (global-set-key "\M-s" 'isearch-forward-regexp) (global-set-key "C-\\" 'quoted-insert) (setq search-repeat-char ?\C-a) (setq search-quote-char ?\C-\\) ;;; ISN editing for emacs (global-unset-key "\C-q") (global-unset-key "\C-s") (global-unset-key "\C-s\C-q") (defun do-nothing () "do nothing, except wait for the control-q" (interactive)) (defvar control-s-map nil "The keymap for the control-s prefix") (setq control-s-map (make-sparse-keymap)) (define-key control-s-map "\C-q" 'do-nothing) (define-key global-map "\C-s" control-s-map) This has the advantage that it can be more easily customized to only override C-s and C-q when you edit over certain terminals. See the file ``/home/cs227/emacs/emacs-over-isn.txt'' for more details. 4. PROBLEMS WITH SPECIFIC TERMINALS AROUND ISU Some terminals are difficult to use, but for that reason may have fewer people using them than other terminals. Here are some hints. On DEC-style keyboards, e.g. on Vincent workstations, sometimes the function key labeled F11 will send an escape (ESC), which is needed for emacs. A more sure way to type ESC, which works from any terminal, is to type C-[ (that is, hold down the ``control key'' (labeled CTL) and type ``['' without the quotes). So to type ``M-x isn-mode'' you actually type ``C-[ x isn-mode''. When you log in to project Vincent, you will be asked what type of terminal you are on. The prompt for this information looks like TERM = (vt100) The ``vt100'' in parentheses is the default---what you get if you just hit ``return''. This default terminal type is usually good for modems, as most terminal emulation programs emulate a vt100 terminal. But it may not work for the terminal you are sitting at if you are not using a modem. To figure out the right terminal type to respond with, look at the terminal and try to locate the appropriate name and model number. For example, a common type is labeled ``VT240''. For these type vt240 at the prompt. If emacs doesn't work right, ask someone for the right thing to type, log out, and log back in. 4.1 THE VT240 AND VT340 TERMINALS These terminals, which are found in Durham 89 and other places on campus are particularly hard for novices to use. But with a little patience you can use them. 4.1.1 Getting a DIAL: prompt To get the DIAL: prompt, type function key 5 (labeled F5) twice to get 2 breaks. Then connect using enet at the DIAL: prompt (as described above). After you log in, when prompted for your terminal type, respond with: vt240 or ``vt340'' (without the quotes) if you're on a VT340. 4.1.2 Typing Escape You can use ``C-['' (control-[) for typing the escape character, ESC. 4.1.3 Fixing Problems If the terminal isn't working at all, use setup key (function key 3, F3, on vt240 terminals) to reset the terminal. After pressing the setup key, use the cursor (arrow) keys to get to ``reset terminal''. Then press the ``enter'' key (not ``return''), go to ``comm'', press ``enter", and set the baud rate to 9600 baud. Then go to ``exit'' using the cursor keys, and press ``enter''. You can now try again. Thanks to Brian Green for the following information. On some vt340 terminals (perhaps also vt240 terminals) various settings can cause emacs to look confused. The symptom is if in emacs you see something like the left hand side of the following instead of the right. ERROR: SHOULD BE: (define whatever (define whatever (lambda (no1 no2 no3) (lambda (no1 no2 no3) (if (if (zero?)no1) no2) (if (zero? no1) no2) (writeln "an)wer 1:") (writeln "answer 1:") (dis (display no2) (display no2) (new)ine)) ) (newline))) One cause of the problem is that the tab stops are mixed up, because emacs expects them to be every 8 characters and they are not. To correct this on vt240 terminals: press the ``set up'' key (F3) and select ``Tabs'', press ``enter'', then select ``8 column tabs'', press ``enter''. (Then go to ``exit'' using the cursor keys, and press ``enter''.) To correct the tab stops on vt340 terminals: press the ``set up'' key, press ``prev screen'' three times, and then select ``Set 8 column tabs''. (Then, I think, go to ``exit'' using the cursor keys, and press ``enter''.) Another cause of the problem is that the terminal is in ``New Line Mode''. To check for this on a vt340, push the ``set up'' button and go to the display set-up. The appropriate setting is the next to the last one. It should read ``no new line'' However, in other applications, this is helpful, because often lines get cut off if the setting is not on ``new line''. 4.2 CONNECTING FROM A MICROCOMPUTER On some personal computers (micros) and perhaps on some Macintosh computers you can connect using ``telnet''. To do this double click on the telnet icon or type telnet vincent1 (or whatever machine you want). The micro will then act as a terminal.