The pipe symbol is sending the ouput of
nano to the input of the
nano is still running and receiving your keyboard input. It's just that you can't see its ouput as
uniq won't ouput it's results until it sees an End-Of-File (this isn't important to the question).
When you press
ctrl-c it is 'caught' by nano, but it does not cause it to exit.
The way to exit nano is to press
nano will not exit if modifications have been made, for example, if you have pressed any other keys since entering. In this case, nano will prompt you with the following:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
N No ^C Cancel
Pressing the 'n' key will exit without saving changes.
It is possible that you hit a few key combinations before realising you were in nano, in which case you may be a few menus deep.
Thankfully in nano pressing
ctrl-x will also exit from most menus (but will not cancel the above prompt), this means pressing
ctrl-x multiple times will never take you further away from the exit.
If you are 'trapped' a few menus 'deep' you can usually get out by pressing
ctrl-x a few times, followed by the
n key. If that does not work, that means that you pressed
ctrl-x one time too many-- just press
ctrl-x one more time, followed by the
n key-- this will always work.