How to avoid bash from accepting non-printable characters at the prompt?How to avoid and recover shell...

What modifiers are added to the attack and damage rolls of this unique longbow from Waterdeep: Dragon Heist?

Sum Square Difference, which way is more Pythonic?

A+ rating still unsecure by Google Chrome's opinion

QgsGeometry.length() giving wrong result?

Why does Japan use the same type of AC power outlet as the US?

Does the Haste spell's hasted action allow you to make multiple unarmed strikes? Or none at all?

Why does auto deduce this variable as double and not float?

Short comic about alien explorers visiting an abandoned world with giant statues that turn out to be alive but move very slowly

Understanding a part of the proof that sequence that converges to square root of two is decreasing.

Duplicate and slide edge (rip from boundary)

May the tower use the runway while an emergency aircraft is inbound?

When does The Truman Show take place?

Why won't the Republicans use a superdelegate system like the DNC in their nomination process?

Is there any official ruling on how characters go from 0th to 1st level in a class?

Minimum population for language survival

What is the purpose/function of this power inductor in parallel?

How does the Moon's gravity affect Earth's oceans despite Earth's stronger gravitational pull?

What is the hottest thing in the universe?

What is the spellcasting ability of a Barbarian Totem Warrior?

What would cause a nuclear power plant to break down after 2000 years, but not sooner?

When was "Fredo" an insult to Italian-Americans?

What is a "soap"?

What was the intention with the Commodore 128?

What exactly happened to the 18 crew members who were reported as "missing" in "Q Who"?



How to avoid bash from accepting non-printable characters at the prompt?


How to avoid and recover shell command history from an unwanted incursion of non-printable characters?Changing the bash promptRemoving non printable characters from expect logs?What are the special characters to print from a script to move the cursor?identify files with non-ASCII or non-printable characters in file nameHow can avoid these spurious characters in my bash prompt?strange characters in the log file from bash + how to avoid them ?How to printf literal characters from/to file in bash?Bash: How to delete characters from line






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I recently ran a command at my shell:



# yum whatprovides xdotool
Error: No Matches found


However, my package manager actually has this package:



# yum whatprovides xdotool
xdotool-1:3.20150503.1-7.fc29.x86_64 : Fake keyboard/mouse input
Repo : @System
Matched from:
Provide : xdotool = 1:3.20150503.1-7.fc29


The problem is that I somehow entered a non-printable character at the prompt which was invisible to me.



Representing this invisible character with (the unicode box character), this is what I typed:



yum whatprovides ☐xdotool


But this is what I saw:



yum whatprovides xdotool


Is there a way to tell bash to disallow the user from entering non-printable characters from the prompt? Are there any use cases where someone would actually want to do this?



And is this a failure of my terminal emulator for not providing a visual indicator?










share|improve this question




















  • 1





    I don't think bash can easily know whether a character will show up visibly on the terminal. I blame this on your terminal emulator.

    – Gilles
    yesterday


















3















I recently ran a command at my shell:



# yum whatprovides xdotool
Error: No Matches found


However, my package manager actually has this package:



# yum whatprovides xdotool
xdotool-1:3.20150503.1-7.fc29.x86_64 : Fake keyboard/mouse input
Repo : @System
Matched from:
Provide : xdotool = 1:3.20150503.1-7.fc29


The problem is that I somehow entered a non-printable character at the prompt which was invisible to me.



Representing this invisible character with (the unicode box character), this is what I typed:



yum whatprovides ☐xdotool


But this is what I saw:



yum whatprovides xdotool


Is there a way to tell bash to disallow the user from entering non-printable characters from the prompt? Are there any use cases where someone would actually want to do this?



And is this a failure of my terminal emulator for not providing a visual indicator?










share|improve this question




















  • 1





    I don't think bash can easily know whether a character will show up visibly on the terminal. I blame this on your terminal emulator.

    – Gilles
    yesterday














3












3








3








I recently ran a command at my shell:



# yum whatprovides xdotool
Error: No Matches found


However, my package manager actually has this package:



# yum whatprovides xdotool
xdotool-1:3.20150503.1-7.fc29.x86_64 : Fake keyboard/mouse input
Repo : @System
Matched from:
Provide : xdotool = 1:3.20150503.1-7.fc29


The problem is that I somehow entered a non-printable character at the prompt which was invisible to me.



Representing this invisible character with (the unicode box character), this is what I typed:



yum whatprovides ☐xdotool


But this is what I saw:



yum whatprovides xdotool


Is there a way to tell bash to disallow the user from entering non-printable characters from the prompt? Are there any use cases where someone would actually want to do this?



And is this a failure of my terminal emulator for not providing a visual indicator?










share|improve this question














I recently ran a command at my shell:



# yum whatprovides xdotool
Error: No Matches found


However, my package manager actually has this package:



# yum whatprovides xdotool
xdotool-1:3.20150503.1-7.fc29.x86_64 : Fake keyboard/mouse input
Repo : @System
Matched from:
Provide : xdotool = 1:3.20150503.1-7.fc29


The problem is that I somehow entered a non-printable character at the prompt which was invisible to me.



Representing this invisible character with (the unicode box character), this is what I typed:



yum whatprovides ☐xdotool


But this is what I saw:



yum whatprovides xdotool


Is there a way to tell bash to disallow the user from entering non-printable characters from the prompt? Are there any use cases where someone would actually want to do this?



And is this a failure of my terminal emulator for not providing a visual indicator?







bash terminal terminal-emulator special-characters






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









ZhroZhro

4005 silver badges16 bronze badges




4005 silver badges16 bronze badges











  • 1





    I don't think bash can easily know whether a character will show up visibly on the terminal. I blame this on your terminal emulator.

    – Gilles
    yesterday














  • 1





    I don't think bash can easily know whether a character will show up visibly on the terminal. I blame this on your terminal emulator.

    – Gilles
    yesterday








1




1





I don't think bash can easily know whether a character will show up visibly on the terminal. I blame this on your terminal emulator.

– Gilles
yesterday





I don't think bash can easily know whether a character will show up visibly on the terminal. I blame this on your terminal emulator.

– Gilles
yesterday










0






active

oldest

votes














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535724%2fhow-to-avoid-bash-from-accepting-non-printable-characters-at-the-prompt%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535724%2fhow-to-avoid-bash-from-accepting-non-printable-characters-at-the-prompt%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...