1

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?

1 Answer 1

0

What a great question!

Confession: This answer is theory, not practice. I've never used the korn shell, and I've never logged into a RPi with an attached monitor.

Anyway, it seems to me that your problem may be solved by not running the set -o ... commands in your .profile except when you are logged in over SSH. Perhaps add something like this to your .profile ? :

if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
    set -o vi 
fi
2
  • Perfect! Thank you so much; all these years I hadn't recognized there were shell variables set specific to SSH sessions. My life is changed! :) I appreciate the simple and workable reply, @Seamus!
    – Dennis
    Commented Jan 22 at 21:06
  • 1
    @Dennis: And thank you - that's the best reception I've ever gotten for an answer :)
    – Seamus
    Commented Jan 23 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.