Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
cursor position in a variable
- X-seq: zsh-users 20516
- From: david sowerby <d_sowerby@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: cursor position in a variable
- Date: Sat, 5 Sep 2015 11:36:45 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1441478206; bh=A85fPCDuWeYlhwTCCkUJg+QgY/ndlTbxJ1cDZQWSUko=; h=Date:From:Subject:To:From:Subject; b=m2cpumpg17Gs/0CT4jzTsc3B0ntryWY8S97oPeV5+RRlLX1v62EgWtdHM+ZGKEryoHUE5ehmwilM5Ei6GC2tj5oubELUeR7vLfrkauC3+DlAloBpkKhF6g5CxeZX46CFCAzrq2xpQ40+VYwco3bOY3JtcTuutDOhtQGQjXB/hVdRHjCdZhCAkOB0Ru3Wkscf5scdCz+vFxyT758tOkREh0+JYb1M3jgF7IomX4yg3Qv2kdAsMcZuWDI2y+zpL113n9OEGF99vlXOuaW3xVv60ujHYtN/SGHXfpD77yFlUhc9b/5HzPWpUzNaAIR2yJUAMXPPvFqv40u1YF1/5N/v/Q==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I can get the cursor position by doing:
print "\e[6n"
this gives me the row and column. Though oddly the output appears after the next prompt, not on its own line. This
may (or nor) be why when I do:
pos=$(print "\e[6n")
print $pos
I get an empty line - and the output after the next prompt.
I want to use the row the cursor is on in a script -- so how do I get that into a variable? If not this way is there a way using ZLE?
thanks for any help --------------dave
====================================================
Never trust a person who can clear their conscience of any immoral
act by asking forgiveness from their imaginary friend.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author