Giter VIP home page Giter VIP logo

go-readline-ny's People

Contributors

glejeune avatar hymkor avatar masamitsu-murase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-readline-ny's Issues

Feature Request: Disable history cycling

Thank you for this project.

Feature request: assume that a user has inputted the following through editor.ReadLine() function:

  1. Hello
  2. There
  3. Morning

If the user presses the UP arrow key for 4 times, than "Morning" will be redisplayed.

Most probably this is due to the following code within history.go

	if this.historyPointer <= 0 {
		this.historyPointer = this.History.Len()
	}

Would it be possible to implement a flag such that, when enabled, if the user presses the UP key >= 4, then only the first input (i.e. "Hello") is displayed?

wezterm support

I saw this tweet: https://twitter.com/NyaosOrg/status/1497486187279175681
and found:

go-readline-ny/moji.go

Lines 15 to 33 in 48b319a

var isWezTerm = os.Getenv("WEZTERM_EXECUTABLE") != ""
var (
// SurrogatePairOk is true when the surrogated pair unicode is supported
// If it is false, <NNNN> is displayed instead.
SurrogatePairOk = isWindowsTerminal || isWezTerm
// ZeroWidthJoinSequenceOk is true when ZWJ(U+200D) is supported.
// If it is false, <NNNN> is displayed instead.
ZeroWidthJoinSequenceOk = isWindowsTerminal
// VariationSequenceOk is true when Variation Sequences are supported.
// If it is false, <NNNN> is displayed instead.
VariationSequenceOk = isWindowsTerminal
// ModifierSequenceOk is false, SkinTone sequence are treated as two
// character
ModifierSequenceOk = isWindowsTerminal
)

I'd like to make some suggestions and invite you to please open issues with wezterm if things aren't working as you expect!

Detecting wezterm

Firstly, I would suggest looking at these two environment variables if you'd like to detect when you are running inside a local wezterm:

; env | egrep '^TERM_'
TERM_PROGRAM=WezTerm
TERM_PROGRAM_VERSION=20220213-203140-4a1c4b55

If you'd like to support the case where you are running in a remote ssh session, you could use a sequence like XTVERSION to probe the terminal version:

  1. Emit \x1b[>q
  2. Read the response string, which for wezterm looks like: ^[P>|WezTerm 20220213-203140-4a1c4b55^[\
  3. That read operation should have a timeout in case the remote terminal doesn't respond to this sequence.

Variation Sequences

These are supported by wezterm when the unicode version is set to enable them.

https://wezfurlong.org/wezterm/config/lua/config/unicode_version.html#unicode-version-escape-sequence describes escape sequences that you can use to enable them for your application

Modifier Sequence

wezterm should support all skin tone and other modifiers out of the box: we use harfbuzz for this and have explicit unit tests to verify that these are shaped correctly.

If you find examples where this isn't true, please file an issue!

ZWJ

These should be supported, but I'm not sure what your criteria for conformance is for these. I would love to hear more!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.