Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!xadmx!rbj@dsys.icst.nbs.gov From: rbj@dsys.icst.nbs.gov (Root Boy Jim) Newsgroups: comp.unix.questions Subject: Defining function keys Message-ID: <19157@adm.BRL.MIL> Date: 17 Apr 89 20:26:20 GMT Sender: news@adm.BRL.MIL Lines: 33 ? From: Alex Crain ? In article <1869@umbc3.UMBC.EDU>, rostamia@umbc3.UMBC.EDU (Rouben Rostamian) writes: ? Is there a way to define function keys to execute ? > certain commands in UNIX? For example, can one press f17 (I have ? > a vt220) to execute "/bin/ps -w -u smith"? ? Well, sort of. Normally, the UNIX tty driver will not send a command ? to the shell until the RETURN key is pressed. THis behaviour is configurable, ? but the result is generally accompanied by a system slowdown. ? You can however, bind command to escape sequences using the csh ? alias feature. for example the above could be accomplished with: ? alias "[31~" 'ps -w -u smith' I assume you mean the "[" to be preceded by a real ESCAPE. ? and then be executed with the sequence: ? ? :alex ? Alex Crain ? Systems Programmer alex@umbc3.umbc.edu ? Univ Md Baltimore County umbc3.umbc.edu!nerwin!alex I use tcsh, and "bind prefix-meta M-[", so the "F17" key actually acts as if I typed 31 tildes. So I can (but haven't bothered to) alias 31 tildes to whatever command I want. Bizarre! Root Boy Jim is what I am Are you what you are or what?