Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can move the cursor with the escape codes, and I can also print at the cursor. What I'd like to know is if it is possible to pull the character under the cursor.

I tried searching for such a code, but failed. So I assume it is not possible, but I'd like to ask if there is some way I failed to find.

share|improve this question
Your shell may be able to do something similar for characters on the current command line (while typing, but before execution); see, for example, the Readline library in man bash and Z-shell's line editor in man zshzle. I'm unaware of any thing that would interact with arbitrary positions in the terminal emulator window. – chepner May 23 '13 at 0:16
up vote 1 down vote accepted

This is not possible unless you modify your terminal emulator to make it possible; use curses library or equivalent.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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