Defining function keys

Root Boy Jim rbj at dsys.icst.nbs.gov
Tue Apr 18 06:26:20 AEST 1989


? From: Alex Crain <alex at wolf.umbc.edu>

? In article <1869 at umbc3.UMBC.EDU>, rostamia at 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:

? 	<F17><Ret>

? 					:alex
? Alex Crain
? Systems Programmer			alex at 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?



More information about the Comp.unix.questions mailing list