Cursor and Tab keys produce control characters when setting up pi-hole

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=20
    G_DIETPI_VERSION_RC=1
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | trixie 1
  • Kernel version | Linux pihole 6.12.62+rpt-rpi-v6 #1 Raspbian 1:6.12.62-1+rpt1 (2025-12-18) armv6l GNU/Linux
  • Architecture | armhf
  • SBC model | RPi Zero (armv6l)
  • Power supply used | Official Pi micro USB2 PSU
  • SD card used | Amazon Basics 16GB (pre-tested and erased before use)

I downloaded and installed dietpi today for a new configuration of pi-hole on a pi zero with no wifi, using a USB to ethernet adaptor.

During the initial setup, I configured fixed ip, dns , nodename etc.

For the dietpi software, I selected pi-hole and unbound.

During the setup, it takes me to a blue screen to install and configure pi-hole.

The first screen warns that you need a fixed ip, the default being to quit to set up fixed ip.

I am unable to move the selection to continue, as the TAB key produces control characters, as do the cursor keys.

Key behaviour was working correctly during the initial configuration (eg for fixed ip).

I rebooted, tried again. Still failed.

This was using a keyboard and screen attached to the local device.

I then tried to ssh from another computer, and had the same problem. I can use the dietpi configuration menus, and step through those with cursors and TAB, but when I reach the pi-hole config setup, the TAB and cursor keys no longer work, instead producing control characters on the screen.

Although this was a fresh install, I’m going to repeat the install to try again, but wondered if there were any known problems in this area (searching didn’t find one)

thanks

Hmm I could not replicate this (in a VM).
Do you use the default terminal? Did you change anything regarding terminal config?

It happened in both the default console with a screen & keyboard plugged into the pi zero, and when I used SSH from another pi using the default pi lxterminal.

I’d not changed any terminal config on the dietpi setup or on the remote terminal setup.

I had configured the keyboard (via the automatically-run setup menu) as English (UK)

I’m just going to try again and see what happens

I omitted something from my post, which has just happened again after a re-install.

After the pi zero has done it’s reboots and requests you to login as root, it runs through doing apt updates and stuff, then tries to reboot again.

At that point, it hangs. Last thing on the screen is “finished dietpi.kill_ssh.service”.

At this point previously, I power cycled to get it to restart. Gonna do that again now.

OK, so after it froze, I power cycled, logged in and let it run the dietpi initial setup. Set keyboard to UK, gave it fixed up and a hostname. Selected pihole and unbound, it downloaded stuff, gave me some dietpi setup warnings to make sure I had fixed ip, started the pihole setup and then.. the pihole menu system won’t let me tab or cursor. Just as before.

I did re-flash using the same image, which I had downloaded from dietpi a few hours ago. I’ve now used the raspberry pi imager to flash dietpi from the imager’s options, will try that soon

last update for now.

The problem is consistent. and there are two problems.

I have re-downloaded the 32bit image multiple times, flashed them to different SD cards, either downloaded from dietpi website or used Raspberry Pi Imager to fetch it for me.

The Pi Zero has a USB ethernet adaptor plugged in, and no wifi. I have used two different USB ethernet adaptors.

  1. After the initial setup and initial log in, it hangs instead of reboots at the “finished dietpi.kill_ssh.service” point.

power cycle, and then configure fixed ip, nodename, keyboard lang, etc. Select pihole and unbound to install.

  1. when it starts running the dietpi setup (and after the dietpi logo appears), the menu that is presented cannot be used, as TAB or cursor keys are displayed as escape codes rather than moving the focus of the cursor. (Cursor moved corectly in previous dietpi menus).

I’ve tried full reinstall 7 times now, result is always the same.

Hardware is Pi Zero with no wifi.

Using the same hardware, I instead installed Raspberry Pi OS lite and on top installed Pi hole and unbound.

All worked ok. The pihole setup menus displayed and I was able to navigate with cursors and TAB keys as expected.

It seems to me that there’s something wrong/missing in the 32 bit Pi Zero image for Dietpi?

If its a hint, I noticed that the menu that pihole setup has a different appearance to the usual whiptail menus that I presume pihole is using. Is that a clue as to what’s going wrong here?

thanks

can you share some pictures, so we know exactly where you are on the installation process.

Two problems here.

Installing dietpi on Raspberry Pi Zero (no wireless) , using USB to Ethernet adaptor.

First boot, resize FS, allocate swap, start network etc. OK
1st login
Checks for updates
Finds 20 APT updates
Installs, attempts to reboot.
It fails to complete shutdown and so never reboots. Last entries on screen are

Stopping networking.service - Raise network interfaces…

Finished dietpi-kill_ssh.service - Dietpi-Kill_SSH on shutdown.

(can’t upload pic as only allowed one per post)

So, I power cycle.
Login again. Asks for keyboard config - choose English (UK)
Menus are all working as expected.
I then select Pihole and Unbound and set the software installing.

Note that menus are so far OK, I am able to cursor around to choose software, and TAB to select “Confirm”

It starts installing the packages and software. We are then into the pihole installer itself

After a few screens where you simply have to press enter to continue (which works OK), you are then given a choice - abort or continue. Default is abort (if you’ve forgotten to set up fixed ip). So I want to tab or cursor across to continue. But I can’t. Cursors and TAB key just produce control codes. See pic 4.

If you continue to try to cursor or TAB, you just get lots of control codes. CTRL-C is your only way out.

After trying this multiple times with different SD cards and a different USB ethernet adaptor, I wondered if it was the Pihole installer at fault. I installed Raspberry Pi OS Lite 32 bit, then installed Unbound (via APT GET) and Pihole (via pihole website) . It all worked fine. Menus worked as expected. It was only using Dietpi and it’s installers that seemed to fail like this.

Thanks

Ian

Here’s the pic of where it hangs earlier on in the install. There is no LED activity, and I tried leaving it over 30 minutes on one try, it just stays on this screen.

ok that’s 2 different thinks.

On the hanging reboot, you would need to power cycle. in rar cases system hangs on reboot, most probably after kernel update

For the PiHole install. This is not the pihole installer you see, it’s an dialog from DietPi software install script, right before the regular Pihole install. usually this should not happen with the tab, causing strange characters. maybe @MichaIng has an idea

For me, it’s happening every time I run the install. I’ve run it 10 + times now, trying to get the pihole install to work, and to photograph the symptoms.

Each time it does it’s initial APT GET UPDATE as part of the setup, it hangs when it tries to reboot.

I’ve just tried it on a Pi Zero W (was previously just a Pi Zero), in case it was relevant. It also hangs on a Zero W when it attempts a reboot.

As said, somehow this happened after kernel update, that is done during installation. Usually it doesn’t happen afterwards.

I misunderstood the reason for it hanging, I understand now.

I just tried it all again with the new dietpi 10.0 and this no longer hangs, but the cursor keys still show as control characters when it gets to the setup of pi-hole and you cannot continue the setup.

I think this failure is within the pihole setup, the menus that do not work are after the ascii-art pi-hole raspberry appears.

Prior to that, the diet-pi menus all work correctly.

(and, separately, pi-hole installs just fine on raspberry pi os with menus functioning correctly)

Actually this is part of the Pi-hole installer. Once I thought about removing prior to running it, since we have a dedicated dialogue about setting up a static IP address. So it seems that the dialog tool (which Pi-hole uses) behaves differently in this case compared to whiptail (which we use).

@sheddyian does this happen when you install it via attached HDMI and keyboard, or via some SSH client, or otherwise? E.g. there were similar issues when calling dialog with TERM=xterm, which is the reason our installer sets it to TERM=linux in that case. But it means that dialog is generally more sensitive to console features to cause visual or input issues.

Since you mentioned TAB or cursor: while TAB at least works in whiptail, I use left/right arrow keys to switch between buttons and up/down to navigate through menus. TAB primarily switches between elements in whiptail, e.g. from the menu down to buttons or back up to menu, but less to navigate within one element. But not 100% sure in case of dialog.

It happens both with ann attached keyboard/screen AND with ssh from another Pi running a terminal. Behaviour was the same.

The problem affects TAB and cursors - they all display control codes rather than moving the cursor about.

I think I was instinctively trying to use TAB to hop to the menu buttons and back again, but regardless, neither TAB nor cursors were working in the pi-hole installer.

The Pi-hole installer worked fine when installed on top of Raspberry Pi os lite, as per the pi-hole web site install instructions.

Hmm, just tested in on a Trixie VM instance via SSH where it works normally:

  • up/down buttons navigate up/down menus if there is one, else do nothing.
  • left/right as well as tab both switch between the bottom buttons if there are multiple ones, else do nothing.

No special characters appear.

If in your case local console as well as SSH behave the same, maybe it is something with the bash environment. It however would be nothing from ~/.bashrc or any such, since those are loaded only in interactive shells (with a command prompt), not in scripts. However, does it behave the same when you open a dialog from the console?

dialog --msgbox test 10 40

Now I see again why we set TERM=linux. With TERM=xterm it looks like this:

vs TERM=linux:

dialog seems to decide that xterm would not be capable of UTF-8 characters, which is funny, because linux is actually the way simpler terminal (AFAIK).

If above does not have the issue, could be actually tested whether the TERM change is what causes this for you:

TERM=linux dialog --msgbox test 10 40

Sorry I took a while to reply, I’ve had other stuff on.

I’ve re-tried the install on a blank SD card, using the dietpi 10 image that I downloaded on 27-JAN-2026.

  1. I installed only a basic diet-pi install with no extra software. The “dialog” command was not present, so I couldn’t do that test.

  2. I then went to dietpi-software to select pi-hole and unbound, thinking that maybe pi-hole installs “dialog” as part of its setup. I expected this to fail as usual, and I was going to control-c out of it to re-try the “dialog” command.

BUT

it now works!

I can move the cursor around with cursor and tab keys when in the pi-hole setup.

This had previously failed every time I tried the install (more than 7 times).

An updated package from the initial apt update?

The hardware I tried it on was the same as previously : Pi zero without wifi, using Ethernet USB dongle.

So, as far as I am concerned this is fixed but I’ve no idea how it fixed itself!

thanks!

Ian

Update : IT ISN’T FIXED!

But here’s a workaround….

Today I downloaded the dietpi 10.0.1 install image from dietpi.com for Pi Zero.

Wrote it to SD card using raspberry-pi imager (selecting custom image and choosing downloaded file).

Booted Pi Zero from it.

Went through dietpi install, allowed it to reboot, selected pi-hole and unbound, and then…

tab and cursor keys do not work when it reaches the pi-hole install. I am unable to move left to select continue. Note the control characters on screen where I have pressed cursor keys. Also note the ‘window’ position on this large screen, it is top-left.

BUT…. see next post!

I then re-wrote the same dietpi install 10.0.1 to the SD card to start again, and once more booted this on the Pi Zero.

I did not select any software to install. When I chose GO (install) it asked me if I wanted a minimal install, and I said YES.

It then completed install without additional software.

I rebooted (possibly not necessary?)

After reboot, I typed dietpi-software

and selected pi-hole and unbound.

I selected install

and after some delay (busy) it takes me to the pi-hole installer…

which now works!!

In this picture I have already used the cursor keys to move left to “continue” (this would not work before).
Note also the centered position on screen of the ‘window’. It was positioned top-left previously when cursors failed.

So… there does seem to be something wrong with dietpi . The workaround is to choose no software, to reboot, and to go back to dietpi-software and then install. And it works!