Hi Stuart,

can I ask what platform are you sshing from and what terminal you are 
using? 

I use emacs over ssh a lot and while I have encountered some of the issues 
you mention, they are in a far more limited way. For example, I have found 
different behaviour between delete and sometimes, Alt doesn't work as 
expected. There can also be some differences in key behaviour between emacs 
running in GUI compared to emacs running in a terminal. Some of this is due 
to different kemaps being used in terminals. 

In nearly all cases, the issue is due to a combination of the terminal 
emulator, the ssh configuration and the terminfo/termcap settings on the 
remote host. Having three points of potential problems certainly doesn't 
make matters easy, but it can be sorted out with a bit of effort. A lot can 
depend on the terminal emulator you are using. 

I use Linux almost exclusively and it is possible that some of the issues 
cannot be easily solved if you are using completely different OSs at each 
end. However, if sshing from Linux to a remote Linux/Unix host, you should 
be able to get consistent behaviour. Some of the things I do are

1. Use either the console-setup or console-tools to get appropriate keymaps 
etc loaded so that differences between console and X behaviour are 
minimized. The console-setup is the more recent package and 'automates' 
more of the process. Console-tools, loadkeys etc give hyou more control. 
This will help ensure that 'special'modifiers, such as shit+tab will work. 

2. Experiment with different terminal emulators. Nearly all can be 
configured to 'do the right thing', but lets face it, none of us really 
want to spend time working this out if we can avoid it. Some terminals are 
better/more consistent than others. Try different emulators and see. 

3. Check local and remote $TERM environment variables. A common problem is 
that the local TERM variable is set to a value which the remote system does 
not understand. The result is that the remote system sets up a dumb or 
basic terminfo setting, which gives basic functionality, but fails to 
provide support for things like Meta, Super, etc. 

4. Check ssh config. Make sure ssh isn't using an escape character you want 
sent to the remote system etc. 

Other alternatives are 

1. Use an X compression protocol to enable runniing native X version of 
emacs remotesly. How well this works depends on your connection speed. 
However, provided you turn off font-lock, this an work very well even on 
quite slow DSL lines. 

2. I suspect we cold do some clever stuff using tramp. Instead of running 
emacs remotely over ssh, run it locally, edit the remote file using tramp 
and set things up so that the local (n)repl can connect to the remote 
instance. However, I don't think nrepl supports this yet (I've done this 
with slime and lisp).

These days, I found more consistent results running emacs remotely in 
daemon mode and then using emacsclient -t to connect. Not entirely sure 
why, but I do seem to get fewer keymapping issues doing it this way rauther 
than just running emacs remotely.

HTH

Tim



On Tuesday, August 28, 2012 10:44:41 AM UTC+10, Stuart Sierra wrote:
>
> It's easy enough to test: fire up a small EC2 instance and use Emacs over 
> an SSH+tmux session. You could also try using your own local Emacs that way 
> by SSH'ing to localhost.
>
> In my experience, commands don't work in a terminal if they use modifier 
> keys (Control, Meta, Shift) AND non-letter keys (arrows, ENTER, some 
> punctuation). I assume it has something to do with how those combinations 
> get encoded for the terminal emulator.
>
> You can always work around it with M-x, or by rebinding the command to a 
> different key. It's mildly annoying, but not a showstopper.
>
> One consistently annoying thing is that PageUp, PageDown, and Delete don't 
> work in clojure-mode buffers with Paredit in Emacs in a terminal. They 
> insert weird characters like ^[ instead. I would very much like to have a 
> fix for that!
>
> -S
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to