Xterm line wrap

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. It only takes a minute to sign up. I need to view large logs files using a bash shell. Since the files are Log4J logs, and there is a pattern in the beginning of each line, having lines wrapped makes it difficult to analyze the output, so I started using less -S which chops long lines.

Customizing Your Terminal: Adding Color and Information to Your Prompt

But now I need to use tail -fand it also line wraps the output. Is it possible to disable line wrap in a bash shell for all the commands?

Since it sounds like you still want an interactive pager, it seems to me it would be much easier to stick with less than to reimplement one yourself. Found a good answer from superuserthat works out of the box for gnome-terminaland probably for other terminals as well:. You can disable line wrapping for lesstail and every other command under the Linux sun with:. One caveat: at least on the built in terminal on my Mac cut does not seem to handle tab characters very well. It seems it displays them with e.

In other words, if your terminal is 80 characters wide and your output contains several tabs per line you must set the width to maybe 60 or something like that. Use below options with less. It will disable word wrap and preserve text colors, if specified. There are a few examples on this page piping tail with -f Some comments were made about the autowrap feature, stating that not all terminals have it.

But aside from terminatorwhose developers document no terminal description all of the examples given were xterm, rxvt and some look-alike or descendent. Those are all related. Consulting the manual, it says that. The others do as well. Whether the feature would be useful to OP is debatable. Suppressing line-wrapping is only one aspect of the problem:.

There are pagers which can do what is needed, e. Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. How to disable line wrap in a terminal? Ask Question. Asked 8 years, 7 months ago. Active 6 months ago. Viewed 76k times. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. When connected to a remote BASH session via SSH with the terminal type set to vtthe console command line will soft-wrap when the cursor hits column The behaviour observed is not really part of bash; rather, it is part of the behaviour of the readline library.

It doesn't happen if you simply use echo which is a bash builtin to output enough text to force an automatic line wrap, nor does it happen if bash produces an error message which is wider than the console. Try, for example, the command. So it's not an official "soft-wrap sequence", nor is it part of any standard. Rather, it's a pragmatic solution to one of the many irritating problems related to console display management.

xterm line wrap

As a result, it is not possible to reliably send a newline after the last column position. If the terminal had already wrapped option 1 abovethen the newline will create an extra blank line. Otherwise option 2the following newline will be "eaten". These days, almost all terminals follow some variant of option 2, which was the behaviour of the DEC VT terminal. In the vocabulary of the terminfo terminal description database, this is called xenl : the "eat-newline-glitch". There are actually two possible subvariants of option 2.

In the one actually implemented by the VT and xtermthe cursor ends up in an anomalous state at the end of the line; effectively, it is one character position off the screen, so you can still backspace the cursor in the same line. Other historic terminals "ate" the newline, but positioned the cursor at the beginning of the next line anyway, so that a backspace would not be possible.

Unless the terminal has the bw capability. This creates a problem for programs which need to accurately keep track of the cursor position, even for apparently simple applications like echoing input. Obviously, the easiest way to echo input is to let the terminal do that itself, but that precludes being able to implement extra control characters like tab completion.

Suppose the user has entered text right up to the right margin, and then types the backspace character to delete the last character typed. Normally, you could implement a backspace-delete by outputting a cub1 move left 1 code and then an el clear to end of line.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.

Subscribe to RSS

In a terminal window any smaller than fullscreen, if I type in a long command it starts overwriting the current line I'm on. If I type an additional line's worth, it finally moves to the next line. Does anyone know how to fix this? For some reason the terminal size is mis-reporting. It should change when you resize the terminal. I found the answer here. The answer with the most votes solved it for me.

Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. How do I keep terminal line from overwriting itself? Asked 7 years, 8 months ago. Active 1 year, 2 months ago. Viewed 15k times.

Active Oldest Votes. Try this in your. Julian Knight Julian Knight 1, 11 11 silver badges 18 18 bronze badges. It looks like this was already in my. Running shopt shows that checkwinsize is on. Resizing the window does change these values, but the text is still messed up.

In fact, post the line defining PS1 in. I updated the question with these answers. Jerinaw Jerinaw 5 5 silver badges 10 10 bronze badges. For those using PuTTY terminal v0. Update the Columns value manually. I changed mine to and that stopped the terminal overwriting on its own line when I type.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here.

Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I am writing a program that prints colored lines, and the more I do with it the more I find myself working around line wrapping issues that come up. The problem is that bash will have line wrapping issues when invisible characters are printed without escapes Learn more.

Line wrapping issues in xterm Ask Question. Asked 7 years, 5 months ago. Active 7 years, 5 months ago. Viewed times. Lastly, if I modify PS1 it works just fine. Mike Fairhurst. Mike Fairhurst Mike Fairhurst 2 2 silver badges 13 13 bronze badges. Active Oldest Votes. V H V H 7, 2 2 gold badges 22 22 silver badges 42 42 bronze badges. Unfortunately the problem I am having is not a coloring or printing issue, but a line wrapping issue.

If I scroll through history, the prompt becomes 11 characters off. If I type 21 characters and then press backspace, it begins deleting the previous line.

This is on a console that is 57 columns wide. I think I understand the issue, to be honest using colours even in a shell script, once the line hits the end of console width a new line with the colour set from above is generated.Welcome to LinuxQuestions. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features.

Registration is quick, simple and absolutely free.

Linux xterm command

Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant.

They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. I'm having persistent problems on several machines with line wrapping, on ssh sessions Any clues for me?

Find More Posts by brycen. Thread Tools. BB code is On. Smilies are On. All times are GMT The time now is PM. Open Source Consulting Domain Registration. Search Blogs.On Unix-like operating systems, the xterm command is a terminal emulator for the X Window System. Several instances of xterm can run at the same time within the same display, each one providing input and output for a shell or another process.

Originally written in for the DEC VAXStation as a stand-alone program, xterm was quickly integrated into X, and today most X terminal emulators are variations of the original xterm code. The -version and -help options are interpreted even if xterm cannot open a display, and along with the -class option, are checked before all other options.

This shell can be changed, however, by providing a parameter to xtermafter all other options, which specifies the pathname of a shell to run. This pathname can be an absolute path or a relative pathand xterm will search the user's PATH environment variable for the specified shell if it cannot find it. The following command line arguments are provided for compatibility with older versions:. The following standard X Toolkit command line arguments are commonly used with xterm :.

The program understands all of the core X Toolkit resource names and classes.

xterm line wrap

Application specific resources e. NAME " are as follows:. The following resources are specified as part of the vt widget class VT They are specified by patterns such as " XTerm. NAME ". If your xterm is configured to support the "toolbar", then those patterns need an extra level for the form-widget which holds the toolbar and vt widget.

A wildcard between the top-level " XTerm " and the " vt " widget makes the resource settings work for either, e. The following resources are specified as part of the tek widget class Tek These are specified by patterns such as " XTerm. NAME ":. The resources that may be specified for the various menus are described in the documentation for the Athena SimpleMenu widget.Review your favorite Linux distribution. Welcome to LinuxQuestions.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features.

Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions. If you need to reset your password, click here.

Having a problem logging in?

xterm line wrap

Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration.

This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Hi, bash is my default shell. When I type a long command line in a terminal, it does not wrap to the next line when I reach the end of the line The commands still work, but it's obviously very inconvenient not to be able to correctly see what you are typing.

If I switch to sh as my shell instead by typeing shthe command lines wrap correctly. But I don't want to use sh. But this causes problems with other applications, notably vim.

The problem occurs in all the graphical terminals xterm, konsole, gnome-terminal, rxvt, etcthough not when I am not using X and TERM is set to vt Can anyone tell me how to get the bash shell to wrap long lines to the next line correctly? It may be a matter of setting TERM to something other than xterm, but I am not very familar with terminfo and how all that works.

Thanks so much for any help you can provide!! My system: RedHat 9. I'm a little confused. Or are you saying this happens when you open a terminal screen on the monitor? OK, I gather you have xterminals and not Windows computers emulating xterminals.