Skip to main content
add detailed description for xterm
Source Link
hildred
  • 5.9k
  • 3
  • 33
  • 43

now this is hackish as all hell but it may work ...

set the terminal id string (the string returned by inquire) to "time ". notice the trailing space. next set your prompt to end with an inquire. now every time your prompt is displayed, the terminal automatically types time and a space for you, at which point you type your command. this won't work with all terminals because many have disabled this functionality to prevent this from happening.

To get this to work with xterm add the following line to your .Xresources and reload it with xrdb

xterm*answerbackString: time ^[0D^[0A URxvt*answerbackString: time ^[0D^[0A xterm_color*answerbackString: time ^[0D^[0A 

where ^[ is an escape (because xterm doesn't like space at the end of the answerbackString I wiggle the cursor.

next add the ENQ to the end of your prompt string (bash specific example):

PS1="${PS1}\[\005\]" 

start a new shell in a fresh xterm and cross your fingers it should work. the \005 is a ENQ the [ and ] tells bash that the \005 doesn't move the cursor.

now this is hackish as all hell but it may work ...

set the terminal id string (the string returned by inquire) to "time ". notice the trailing space. next set your prompt to end with an inquire. now every time your prompt is displayed, the terminal automatically types time and a space for you, at which point you type your command. this won't work with all terminals because many have disabled this functionality to prevent this from happening.

now this is hackish as all hell but it may work ...

set the terminal id string (the string returned by inquire) to "time ". notice the trailing space. next set your prompt to end with an inquire. now every time your prompt is displayed, the terminal automatically types time and a space for you, at which point you type your command. this won't work with all terminals because many have disabled this functionality to prevent this from happening.

To get this to work with xterm add the following line to your .Xresources and reload it with xrdb

xterm*answerbackString: time ^[0D^[0A URxvt*answerbackString: time ^[0D^[0A xterm_color*answerbackString: time ^[0D^[0A 

where ^[ is an escape (because xterm doesn't like space at the end of the answerbackString I wiggle the cursor.

next add the ENQ to the end of your prompt string (bash specific example):

PS1="${PS1}\[\005\]" 

start a new shell in a fresh xterm and cross your fingers it should work. the \005 is a ENQ the [ and ] tells bash that the \005 doesn't move the cursor.

Source Link
hildred
  • 5.9k
  • 3
  • 33
  • 43

now this is hackish as all hell but it may work ...

set the terminal id string (the string returned by inquire) to "time ". notice the trailing space. next set your prompt to end with an inquire. now every time your prompt is displayed, the terminal automatically types time and a space for you, at which point you type your command. this won't work with all terminals because many have disabled this functionality to prevent this from happening.