1

I use VNC to connect from my Windows 10 laptop to my Raspberry Pi 3 running Rasbian Buster. It all works fine as expected except for the LXTerminal window not displaying the full command prompt. enter image description here

When I SSH to the same Raspberry Pi: enter image description here

The command prompt in the VNC window also does not let me use any of the special keys (cursors to select previous commands, tab to auto fill folder/file names, etc.)

How can I get the LXTerminal window to operate correctly?

1
  • I found out the cause of this problem. To get VNC Server to run at boot, I added the following line to "crontab -e": @reboot vncserver -geometry 1440x900 -IdleTimeout 0 This appears to be causing this to happen as if I don't add this line and just run the command vncserver -geometry 1440x900 -IdleTimeout 0 after booting the prompt is correct.
    – trlaing
    Commented Apr 18, 2021 at 8:43

2 Answers 2

1

Okay, I sorted it by changing the LXTerminal shortcut from:

enter image description here

To:

enter image description here

Now .bashrc loads each time I open the LXTerminal window, the prompt is displayed correctly and the tab and cursor keys work properly.

0

The prompt is normally set in your .bashrc file in the Pi home directory. My guess is you have an error in that.

Can you run any command from the terminal? I ask as it is possible that your prompt thinks it is part way through a command (as it looks like the second prompt)...

If not, try ctrl-c or ctrl-z. If neither work then ssh into the Pi and

Use ps aux and find the pid of lxterminal Use kill -9 pid to end the session Repeat above till all lxterminal sessions are ended

If you can run commands, the following lines could be missing from the .bashrc file:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

This page here details some of the many many options!

6
  • Yes, I can run commands from the command line, but none of the alias commands. eg. "ls" works fine "ll" does not. CTRL-C and CTRL-Z both just display ^C / ^Z I'm sure that I mentioned that when I SSH into the same Pi, the command prompt displays correctly. .bashrc is present and loads correctly when connecting via SSH. The color_prompt lines are present in my .bashrc file in the home/pi folder.
    – trlaing
    Commented Feb 27, 2021 at 5:22
  • Have you changed your .bashrc? Its possible that the file is erroring somewhere and not setting things correctly (esp if you expect ll to work). I put my alias commands in ~/.bash_aliases to avoid errors. I've put my bashrc script up on pastebin pastebin.com/raw/485FKUFq if you want to backup yours and try that.
    – user130616
    Commented Feb 27, 2021 at 13:54
  • I've only added some aliases. The .bashrc works fine in a Putty SSH window and when using the Raspberry Pi with HDMI to a monitor with the desktop loaded. It is only when remotely connecting via VNC that I have this issue. I have Raspberry Pi 4 next to it that I can connect to using VNC which displays the prompt correctly.
    – trlaing
    Commented Feb 28, 2021 at 14:50
  • It has the same issue with your .bashrc. It looks like it just isn't loading it at all. If I remove .bashrc completely it behaves the same in the VNC window.
    – trlaing
    Commented Feb 28, 2021 at 14:58
  • If I try running the command ./.bash_profile I get different results depending on if I connected using SSH or VNC. WIth SSH: pi@WorkPi3:~ $ ./.bash_profile pi@WorkPi3:~ $ With VNC: $ ./.bash_profile ./.bash_profile: 1: ./.bash_profile: source: not found $ VNC has a "source: not found" error and SSH doesn't.
    – trlaing
    Commented Feb 28, 2021 at 15:12

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.