zsh-workers
 help / color / mirror / code / Atom feed
* Weird behaviour of a multiline prompt
@ 2016-10-29 18:13 Nikolay Aleksandrovich Pavlov (ZyX)
  2016-10-29 18:41 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Aleksandrovich Pavlov (ZyX) @ 2016-10-29 18:13 UTC (permalink / raw)
  To: Zsh hackers list

If I have a prompt like

    PS1=$'abc\n'

(i.e. non-empty line above an empty prompt) then it shows up as expected when I replace my prompt with this. But when I try using exactly the same prompt in `pexpect` zsh no longer shows any prompt at all: neither `abc`, nor RPS1. Used environment is

	environ = {
		'LANG': 'en_US.UTF-8',
		'PATH': os.pathsep.join(local_paths),
		'TERM': 'screen-256color',
		'DIR1': os.environ['DIR1'],
		'DIR2': os.environ['DIR2'],
		'XDG_CONFIG_HOME': os.path.abspath(os.path.join('tests', 'shell', 'fish_home')),
		'IPYTHONDIR': os.path.abspath(os.path.join('tests', 'shell', 'ipython_home')),
		'PYTHONPATH': python_paths,
		'POWERLINE_CONFIG_OVERRIDES': os.environ.get('POWERLINE_CONFIG_OVERRIDES', ''),
		'POWERLINE_THEME_OVERRIDES': os.environ.get('POWERLINE_THEME_OVERRIDES', ''),
		'POWERLINE_CONFIG_PATHS': os.path.abspath(os.path.join('powerline', 'config_files')),
		'POWERLINE_COMMAND_ARGS': os.environ.get('POWERLINE_COMMAND_ARGS', ''),
		'POWERLINE_COMMAND': os.environ.get('POWERLINE_COMMAND', ''),
		'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''),
	}

(https://github.com/ZyX-I/powerline/blob/bd84cd240ed1ddda8d558079f96d6a47d21206fd/tests/test_shells/run_script.py#L52-L67). Zsh version is 5.2. Any ideas what may be the reason?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Weird behaviour of a multiline prompt
  2016-10-29 18:13 Weird behaviour of a multiline prompt Nikolay Aleksandrovich Pavlov (ZyX)
@ 2016-10-29 18:41 ` Bart Schaefer
  2016-10-29 21:44   ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2016-10-29 18:41 UTC (permalink / raw)
  To: Zsh hackers list

On Oct 29,  9:13pm, Nikolay Aleksandrovich Pavlov (ZyX) wrote:
}
}     PS1=$'abc\n'
}
} (i.e. non-empty line above an empty prompt) then it shows up as
} expected when I replace my prompt with this. But when I try using
} exactly the same prompt in `pexpect` zsh no longer shows any prompt at
} all: neither `abc`, nor RPS1.

Check to see if the SINGLE_LINE_ZLE option has become set when inside
pexpect?  RPS1 is not printed in single-line mode, and only the last
line of PS1.

Fix would be to force the environment value of LINES to be something
greater than 1 for pexpect.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Weird behaviour of a multiline prompt
  2016-10-29 18:41 ` Bart Schaefer
@ 2016-10-29 21:44   ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrovich Pavlov (ZyX) @ 2016-10-29 21:44 UTC (permalink / raw)
  To: Bart Schaefer, Zsh hackers list



29.10.2016, 21:49, "Bart Schaefer" <schaefer@brasslantern.com>:
> On Oct 29, 9:13pm, Nikolay Aleksandrovich Pavlov (ZyX) wrote:
> }
> } PS1=$'abc\n'
> }
> } (i.e. non-empty line above an empty prompt) then it shows up as
> } expected when I replace my prompt with this. But when I try using
> } exactly the same prompt in `pexpect` zsh no longer shows any prompt at
> } all: neither `abc`, nor RPS1.
>
> Check to see if the SINGLE_LINE_ZLE option has become set when inside
> pexpect? RPS1 is not printed in single-line mode, and only the last
> line of PS1.

My test suite is testing multiline prompts which also have PS1 and this works, up until I do not try to use prompt with empty last line. A check shows that `$options[singlelinezle]` evaluates to `off` while this problem is in effect.

>
> Fix would be to force the environment value of LINES to be something
> greater than 1 for pexpect.

Though making $LINES actually be 3 (in pexpect I used 1x300 screen, 2x300 neither did work well) fixes this bug and previously ignored bug with RPS1 not showing up was also fixed, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-29 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-29 18:13 Weird behaviour of a multiline prompt Nikolay Aleksandrovich Pavlov (ZyX)
2016-10-29 18:41 ` Bart Schaefer
2016-10-29 21:44   ` Nikolay Aleksandrovich Pavlov (ZyX)

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).