Comments (2)
It seems the ansi sequence impact the regex match
-re 'pi@raspberrypi: ~' works (note: space between : and ~)
pi@raspberrypi:~ $ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\]
pi@raspberrypi:~ $
b'\r\n\x1b]0;pi@raspberrypi: ~\x07\x1b[01;32mpi@raspberrypi\x1b[00m:\x1b[01;34m~ $\x1b[00m \r\n\x1b]0;pi@raspberrypi: ~\x07\x1b[01;32mpi@raspberrypi\x1b[00m:\x1b[01;34m~ $\x1b[00m '
from sexpect.
You're right. Sometimes $PS1
has parts of it colorized. You need to take that into consideration when writing the regex pattern. Usually I would change PS1 after successful login to make things easier.
from sexpect.
Related Issues (20)
- The option "-zombie-ttl N" does not work as expected HOT 2
- Add test for "-zombie-idle N"
- [v2.3.4] issue with "-zombie-idle" HOT 1
- [v2.3.7] interact -re PATTERN: detach upon matching a specified pattern HOT 2
- [v2.3.7-dev] 2 issues with "interact -re"
- Implement "interact_out" like in Expect? HOT 2
- Don't run the specified command as session leader? HOT 1
- cmake: add "make install" support HOT 2
- [v2.3.8] 0.4% CPU usage on macOS 11.6 (32GB Mem) HOT 1
- syntax error: unexpected "(" HOT 3
- [v2.3.10] "-nonblock on": don't drop data too quickly HOT 1
- [v2.3.9] Add version check when the client connects to the server HOT 1
- [v2.3.11] New subcommand "get -expect-buf N": dump data in the internal expect buffer HOT 2
- [doc] get -expect-buf
- Release missing tags HOT 1
- [v2.3.12] Add an option to pass a file descriptor to the "send" command HOT 17
- [v2.3.13] interact -subst PATTERN::REPLACE HOT 1
- [v2.3.14] add a new cli option to enable "regcomp(cflags|=REG_NEWLINE)"
- Add testcases for v2.3.12..v2.3.14
- option to discard color codes & al HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sexpect.