| View previous topic :: View next topic |
| Author |
Message |
mattikus
Joined: 06 Aug 2008 Posts: 15
|
Posted: Wed Aug 06, 2008 6:03 pm Post subject: How to change hardcoded behavior for ctrl-c |
|
|
I recently found tintin after deciding to get back into mudding. I was looking for a nice console client and this seems like its perfect for my needs. However, I'm quite addicted to the console and my hands are trained to hit ctrl-c whenever i mess up a line on the bash terminal, which will reset the input.
I've looked around in the source and I thought I've changed every instance of ctrl-c being hardcoded, but it still persists.
Ideally, i'd like to have ctrl-d be the exit mud command, with ctrl-c being cursor_clear_line.
I tried to set them using #cursor ingame, however #cursor {exit} {anything} will be interpreted as a literal exit.
Anything obvious i'm missing? |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3281
|
Posted: Thu Aug 07, 2008 12:29 pm Post subject: |
|
|
It's hard to find because tintin uses a signal handler to catch ctrl-c.
terminal.c around row 67 replace
DEL_BIT(io.c_lflag, ECHO|ECHONL|IEXTEN);
with
DEL_BIT(io.c_lflag, ECHO|ECHONL|IEXTEN|ISIG);
#macro {\C-c} {#cursor clear left;cursor clear right}
As of the next release I'll enable ISIG by default and I'll also add a #cursor clear line option. |
|
| Back to top |
|
 |
mattikus
Joined: 06 Aug 2008 Posts: 15
|
Posted: Thu Aug 07, 2008 12:56 pm Post subject: |
|
|
Yep, that did the trick just nicely. Ctrl-C is now mapped to #clear line, which apparently is implemented, just not expressed via the config. I have ctrl-d replace the original behavior of ctrl-c which feels much more natural to me.
Thanks! |
|
| Back to top |
|
 |
|