With fish commandline command I can get current process part of commandline and current cursor position in entire buffer, but not in current process, e.g for commandline buffer

> echo test; echo $flounder

(with the cursor on the 'o' of 'flounder')

> commandline -

going to return

echo $flounder


> commandline -Cp

Could I somehow obtain cursor position in current process (8 for this example)?

> commandline -Cp

returns error.

UPD: I think

> string length (commandline -cp)

would return exactly what I want

> string length (commandline -cp)

works fine

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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