All my configuration is stored in my github account (https://github.com/mnebuerquo/dotfiles) so I can just clone my repo and run my install script and my home is configured to use all my tools. I install my dotfiles repo to my home in any server I set up, so it's convenient and I don't have to switch back to vanilla vim and tmux controls.

I just started using JuiceSSH from my Nexus 6, and I want to be able to attach to my tmux sessions from my phone.

The problem comes in when I use tmux. The terminal behavior on JuiceSSH is different from that of something like Gnome Terminal on Ubuntu. Juice seems to be sending ctrl+j, while other terms send ctrl+m.

This isn't a problem so far except in tmux. I'm using the vim+tmux navigator (https://github.com/christoomey/vim-tmux-navigator) to bind ctrl+h, ctrl+j, ctrl+k, ctrl+l to navigate between panes in vim and tmux. When I hit the enter key on my phone keyboard, it navigates to the next lower pane in tmux (C-j). When I do ctrl+m from any device, I get the carraige return that I'm looking for. When I am not using my own tmux.conf, where C-j is not bound, then the enter key works on my phone with JuiceSSH.

What I want to do is change my terminal configuration in my .bashrc or something to fix this so it works with tmux regardless of what my terminal sends for the enter key.

3 Answers 3


If the phone literally emits c-j, then no, the only solution is to change the binding in tmux-navigator. And I think ssh is purely byte-based. (You can also send unix signals e.g. like ctrl+c / interrupt, but that's it). It's able to work because your phone tells the ssh server it's using c-j as newline when the session opens.

RFC 4254 - The Secure Shell (SSH) Connection Protocol


I think you want:

stty -icrnl

...though that seems a little strange to me. It's my understanding that apple systems default to a \return line-ending, but on all of my linux systems a default stty sane terminal will do exactly the opposite and translate input carriage returns newlines. Your Android device and my linux systems share a system kernel - which is what handles the terminal line-discipline that stty settings affect. Still, to send through a \return when you press \return you can just tell it to stop that.


Thanks for your answers, guys!

It looks like my problem was solved even as I was asking the question. JuiceSSH just released an update which fixes the enter key problem.


The July 25 JuiceSSH update "Fixed enter key in Nano when using the latest version of Google Keyboard" seems to be the solution to my problem. I found the update after asking the question this morning but before reading the responses this afternoon.

So, @mikeserv, you are correct that it seems a little strange. I was trying to work around a bug in the phone app by binding keys in a weird way. But that's not necessary anymore, since the phone now sends the correct character.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .