I use KornShell almost exclusively, and I use the following in my .profile for all systems that I log in to:
set -o vi
Recently, I began using the desktop for Raspberry Pi (all these years, I've been using only SSH access for all my many Pi devices. I found that, after I installed some basic software (ksh, php, a few others) and copied my standard .profile onto a fresh system, I could no longer log into the windows system... it would accept my password, blank the screen, and return to login (!!!!!). No logs or error messages I could find resulted from this problem, it just silently refused to log me in. Or it logged me in, did nothing and then waited for me to log in again - who's to say?
It took me a LONG time (and literally days of searching, off and on, for help with things like "raspbian blank display and return to login" and on and on...). Only today I identified that my problem was with .profile, so commented all lines of my .profile and then painstakingly went through this process to identify the problem:
One line or section at a time:
uncomment only one line or section of .profile
Reboot
Observe whether can log in, modify .profile accordingly for next test
After going through this process for my entire .profile, it turned out that only the lines that had "set -o vi" or "set -o vi-tab-complete" would cause this phenomena. (Lest I confuse you, the actual code looks like the following.)
set -o vi
set -o vi-tabcomplete 2>/dev/null # Some systems need this, some don't support it
I love the way 'set -o vi' (or with tab-complete) works with KornShell, and it has become a part of my daily life for so many years, so I want to keep it. But I only need it on a terminal, and I avoid xterm and so on. (Call me a relic, I don't mind.)
How can I change my .profile so that it doesn't impact the desktop display while maintaining that set -o functionality that I use on so many other systems?