By the very nature of how terminals work, the cursor is "owned", controlled by the application that's running inside. The cursor denotes the next position where the application's output will be printed at.
Should you somehow forcefully modify this position in the terminal, unbeknownst to the application, most likely subsequent output printed by the application will corrupt the screen big time.
What a few terminal emulators do is that they try to guess what keypresses to synthesize towards the application, so that in response the application will end up moving the cursor to the location where you wish to.
Any such heuristic has obviously very limited use, and is likely to break pretty often. How would the terminal know which application is running? Using hacks like digging into /proc
or equivalent, which stops working across an ssh
, tmux
or other similar layers? If it knows what application is running (e.g. a shell or a text editor), how would it know what state that application is in (e.g. is the shell running a command or waiting for you to type a command? If the latter, is it perhaps in some special mode of readline? If it's a text editor, are you editing a file or are you in some other mode (e.g. a command line, a dialog etc.)? Does it have split screen, and do you need to jump to a different panel?) Shall we begin to teach the behavior of some well-known applications to the terminal? Hopeless.
No wonder that only very few terminal emulators try to offer you this convenience feature. I haven't tried this feature yet in any of them, but I'm pretty sure I'd find a plethora of bugs in just a few minutes. It's impossible to reliably know which keypresses need to be emitted so that the applicaton's response will be to move the cursor to the spot you requested. Any work that any terminal offers you is necessarily a fragile guesswork.
I'm not sure what you mean by "Ubuntu terminal", but based on the tags of the question you probably mean GNOME Terminal. Like the majority of the terminals out there, GNOME Terminal doesn't attempt to address the impossible.
You should get familiar with the power features of the applications you're using. Does the application support mouse? Maybe you need to enable it, and then the application receives mouse clicks and most likely moves the cursor there. If not, are there any keyboard shortcuts that move the cursor in bigger steps? E.g. Ctrl+Left, Ctrl+Right to jump by words? Newer versions of bash
and readline
can jump up and down to the next visual row, which I've personally connected to Ctrl+Up, Ctrl+Down. Etc. There's no "one size fits all" solution for repositioning the cursor.