mmdienel Posted July 30, 2015 Posted July 30, 2015 Hallo, first I want to thank Igor for the creation of armbian, great stuff! Many thanks. Now to my issue: While setting up a Lamobo R1 with armbian i was not able to get F-keys F1 to F4 working in Midnight Commander (apt-get install mc). With all three flavours (whezzy, jessie and trusty) it is the same. I tried dpkg-reconfigure keyboard-configuration dpkg-reconfigure locales to get it working with my german (qwertz) keyboard. The behaviour is the same for local and remote (ssh). Tried also to bulid new image based on https://github.com/igorpecovnik/lib with # user DEST_LANG="de_DE.UTF-8" # sl_SI.UTF-8, en_US.UTF-8 CONSOLE_CHAR="UTF-8" # console charset TZDATA="Europe/Berlin" # time zone without any succsess. During setup of x86-machines as well as the Beaglebone Black with Debian or Ubuntu I never had this issue. Any hints? Michael
tkaiser Posted July 30, 2015 Posted July 30, 2015 What does the output of "echo $TERM" looks like? In case it's "linux" you might give the following a try: TERM=xterm mc
mmdienel Posted July 30, 2015 Author Posted July 30, 2015 echo $TERM gives "linux". With "TERM=xterm mc" the F-keys behave correct. How to set this persistant?
tkaiser Posted July 30, 2015 Posted July 30, 2015 echo $TERM gives "linux". With "TERM=xterm mc" the F-keys behave correct. How to set this persistant? I don't know where the defaults are stored. So it depends on the shell you use. If you're using zsh you would add "export TERM=xterm" to ~/.zshrc and if you're using bash instead you would have to write it to both ~/.bashrc and ~/.bash_profile (see chapter INVOCATION in bash's manual page -- for whatever reason one file is read when you start a login shell and the other if it's a not a login shell)
mmdienel Posted July 30, 2015 Author Posted July 30, 2015 Found the solution or the cause of the different behaviour, deppends on how you look at it: Difference between ambian and x86 Debian or Ubuntu is the following: There is a file /etc/bash.bashrc.custom: if [ ${TERM} == "dumb" ]; then return fi export TERM=linux OUT="" ... This is never reverted and breaks the at least to me well known behaviour of mc. To fix this I added export TERM=xterm at the end of /etc/bash.bashrc.custom.
tkaiser Posted July 30, 2015 Posted July 30, 2015 Glad you resolved it. But you should be prepared that other stuff might break now (I believe this is defined for a reason). $TERM is an ugly beast ;-) An alternative approach is to use aliases (since it seems to only affect one single tool you use). alias mc="TERM=xterm /usr/bin/mc" in one of the startup files read by bash and you're done (and don't introduce yet unknown side effects). Also useful if you've other terminal related problems or you just dislike colors in some programs: alias mcm="TERM=xterm-mono /usr/bin/mc" Now "mcm" would invoke a b/w mc instance. Aliases are powerful. Since I'm a lazy guy I even use them to open stuff from the command line in Cocoa apps (on OS X -- of course ) macbookpro-tk:~ tk$ type photoshop photoshop is aliased to `open -a /Applications/Adobe\ Photoshop\ CC\ 2015/Adobe\ Photoshop\ CC\ 2015.app'
Recommended Posts