Shell icon indicating copy to clipboard operation
Shell copied to clipboard

Clipboard.is_empty doesn't work as intended

Open andreaxhearts opened this issue 2 years ago • 2 comments

The clipboard function that is documented lists clipboard.is_empty, which is used to verify that there is a value stored in the clipboard. But regardless of if text is stored in the clipboard or not, it always returns 0.

item(title='clear clipboard ' + clipboard.is_empty cmd=clipboard.empty vis=if(clipboard.is_empty==1, 'hidden', 'normal'))

andreaxhearts avatar Sep 17 '24 19:09 andreaxhearts

There's a minor error in FuncExpression.cpp on line 738.

It should be _result = 1;

case IDENT_CLIPBOARD:
{
				switch(Id[1])
				{
					case IDENT_EMPTY:
						Text::Clipboard::Empty();
						break;
					case IDENT_IS_EMPTY:
					case IDENT_LEN:
					case IDENT_LENGTH:
					{
						_result = 1;

AlexW-13 avatar Oct 22 '24 01:10 AlexW-13

Fixed in Nilesoft Shell Pro 2.0.5, a community fork of Nilesoft Shell that I maintain (not an official Nilesoft build). clipboard.is_empty returns 1 when the clipboard has no text.

Release: https://github.com/Abdullah-Masood-05/Shell/releases/latest. Uninstall the original Nilesoft Shell first, since the two don't replace each other.

Abdullah-Masood-05 avatar Oct 18 '26 08:10 Abdullah-Masood-05